Skip to content

Conversation

@Anishpras
Copy link
Contributor

🛠 Fix: Updated Novu SDK Initialization Example

The previous documentation used a deprecated method for initializing the Novu SDK via @novu/js. This update corrects the code snippet and clarifies the recommended usage for developers using the Headless <Inbox /> component.

🚨 Problem

The documentation previously showed:

import { Novu } from "@novu/js";

const novu = new Novu({
  apiKey: 'YOUR_API_KEY',
});

However, this is no longer valid in the latest versions of the SDK, as the apiKey parameter is not recognized or used.

Solution:

import { Novu } from "@novu/js";

```ts title="Initialize Novu SDK (Correct Usage)"
export const novu = new Novu({
  applicationIdentifier: 'YOUR_APPLICATION_IDENTIFIER',
  subscriberId: 'YOUR_SUBSCRIBER_ID',
});

@Anishpras Anishpras requested a review from Aviatorscode2 as a code owner May 4, 2025 06:07
@netlify
Copy link

netlify bot commented May 4, 2025

Deploy Preview for docs-novu ready!

Name Link
🔨 Latest commit 5a699db
🔍 Latest deploy log https://app.netlify.com/sites/docs-novu/deploys/6817122e3096f100085731c7
😎 Deploy Preview https://deploy-preview-835--docs-novu.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Anishpras Anishpras changed the title Update headless.mdx fix:Update <Inbox /> Headless Tab Docs for @novu/js SDK Initialization May 4, 2025
@Anishpras
Copy link
Contributor Author

@scopsy Done ✅

@scopsy scopsy merged commit 9357fb3 into novuhq:main May 4, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants