From d42cde87e853418b088ebd6ae5573e55c039974b Mon Sep 17 00:00:00 2001 From: Dima Grossman Date: Tue, 3 Dec 2024 23:33:34 +0200 Subject: [PATCH] fix: examples --- apps/dashboard/src/pages/api-keys.tsx | 30 ++++++++++++--------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/apps/dashboard/src/pages/api-keys.tsx b/apps/dashboard/src/pages/api-keys.tsx index 0bc8ef5b5d8..b4ab4e31b99 100644 --- a/apps/dashboard/src/pages/api-keys.tsx +++ b/apps/dashboard/src/pages/api-keys.tsx @@ -133,25 +133,21 @@ export function ApiKeysPage() {
Authorization: ApiKey YOUR_API_KEY
-

Example Request

+

SDK Usage

-                    {`fetch('https://api.novu.co/v1/notifications', {
-  method: 'POST',
-  headers: {
-    'Authorization': 'ApiKey YOUR_API_KEY',
-    'Content-Type': 'application/json'
+                    {`import { Novu } from '@novu/node'; 
+
+const novu = new Novu(process.env['NOVU_SECRET_KEY']);
+
+novu.trigger('workflow-id', {
+  to: {
+    subscriberId: '123456'
   },
-  body: JSON.stringify({
-    name: "Trigger Name",
-    to: {
-      subscriberId: "...",
-      email: "..."
-    },
-    payload: {
-      // your custom payload
-    }
-  })
-});`}
+  payload: {
+
+  }
+});
+`}