Get started
Novu for...
Concepts
Build workflows
Channels
- In-App
- Email
- SMS
- Push
- Chat
Additional Resources
Backend
NodeJS SDK
Connect a Node.js application to Novu
Novu’s Node.js SDK provides simple, yet comprehensive notification management, and delivery capabilities through multiple channels that you can implement using code that integrates seamlessly with your Node.js application.
Explore the source code on GitHub
Installation
Copy
npm add @novu/api
Copy
npm add @novu/api
Copy
pnpm add @novu/api
Copy
yarn add @novu/api zod
# Note that Yarn does not install peer dependencies automatically. You will need
# to install zod as shown above.
Copy
bun add @novu/api
Usage
Copy
import { Novu } from "@novu/api";
const novu = new Novu({
secretKey: "<YOUR_SECRET_KEY_HERE>",
});
async function run() {
const result = await novu.trigger({
to: {
"subscriberId": "subscriber_unique_identifier",
"firstName": "Albert",
"lastName": "Einstein",
"email": "albert@einstein.com",
"phone": "+1234567890",
},
workflowId: "workflow_identifier",
payload: {
"comment_id": "string",
"post": {
"text": "string",
},
},
overrides: {
"email": {
"bcc": "no-reply@novu.co"
},
},
});
// Handle the result
console.log(result);
}
run();
Copy
import { Novu } from "@novu/api";
const novu = new Novu({
secretKey: "<YOUR_SECRET_KEY_HERE>",
});
async function run() {
const result = await novu.trigger({
to: {
"subscriberId": "subscriber_unique_identifier",
"firstName": "Albert",
"lastName": "Einstein",
"email": "albert@einstein.com",
"phone": "+1234567890",
},
workflowId: "workflow_identifier",
payload: {
"comment_id": "string",
"post": {
"text": "string",
},
},
overrides: {
"email": {
"bcc": "no-reply@novu.co"
},
},
});
// Handle the result
console.log(result);
}
run();
Copy
import { Novu } from "@novu/api";
const novu = new Novu({
secretKey: "<YOUR_SECRET_KEY_HERE>",
serverUrl: "https://eu.api.novu.co",
});
async function run() {
const result = await novu.trigger({
to: {
"subscriberId": "subscriber_unique_identifier",
"firstName": "Albert",
"lastName": "Einstein",
"email": "albert@einstein.com",
"phone": "+1234567890",
},
workflowId: "workflow_identifier",
payload: {
"comment_id": "string",
"post": {
"text": "string",
},
},
overrides: {
"email": {
"bcc": "no-reply@novu.co"
},
},
});
// Handle the result
console.log(result);
}
run();
Was this page helpful?
On this page
Assistant
Responses are generated using AI and may contain mistakes.