diff --git a/lib/novu/index.tsx b/lib/novu/index.tsx new file mode 100644 index 00000000..e755e054 --- /dev/null +++ b/lib/novu/index.tsx @@ -0,0 +1,22 @@ +import { Novu } from "@novu/node"; + +export default async function sendNotification(subscriberId: string) { + try { + const novu = new Novu(process.env.NOVU_API_KEY || ""); + + await novu.subscribers.identify(subscriberId, {}); + + novu.trigger("pft", { + to: { + subscriberId, + }, + actor: "https://media.tenor.com/iwXHwlY31ecAAAAM/yuji-itadori-suku.gif", + payload: {}, + }); + + return subscriberId; + } catch (error) { + console.error("Error sending notification :", error); + throw error; + } +}