mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 08:11:13 -05:00
feat: Implement Novu package migration
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { serve } from "https://deno.land/std@0.168.0/http/server.ts";
|
||||
import { Novu } from "npm:@novu/node@2.0.2";
|
||||
import { Novu } from "@novu/api";
|
||||
|
||||
const corsHeaders = {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
@@ -18,18 +18,17 @@ serve(async (req) => {
|
||||
throw new Error('NOVU_API_KEY is not configured');
|
||||
}
|
||||
|
||||
const novu = new Novu(novuApiKey, {
|
||||
backendUrl: Deno.env.get('VITE_NOVU_API_URL') || 'https://api.novu.co',
|
||||
const novu = new Novu({
|
||||
apiKey: novuApiKey,
|
||||
baseURL: Deno.env.get('VITE_NOVU_API_URL') || 'https://api.novu.co',
|
||||
});
|
||||
|
||||
const { workflowId, subscriberId, payload, overrides } = await req.json();
|
||||
|
||||
console.log('Triggering notification:', { workflowId, subscriberId });
|
||||
|
||||
const result = await novu.trigger(workflowId, {
|
||||
to: {
|
||||
subscriberId,
|
||||
},
|
||||
const result = await novu.events.trigger(workflowId, {
|
||||
to: subscriberId,
|
||||
payload,
|
||||
overrides,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user