API Reference
Subscribers
- GETGet subscribers
- POSTCreate subscriber
- POSTBulk create subscribers
- GETGet subscriber
- PUTUpdate subscriber
- DELDelete subscriber
- PUTUpdate subscriber credentials
- DELDelete subscriber credentials by providerId
- PATCHUpdate subscriber online status
- GETGet subscriber preferences
- GETGet subscriber global preferences
- PATCHUpdate subscriber preference
- PATCHUpdate subscriber global preferences
- GETGet in-app notification feed for a particular subscriber
- GETGet the unseen in-app notifications count for subscribers feed
- POSTMark a subscriber feed message as seen
- POSTMarks all the subscriber messages as read, unread, seen or unseen. Optionally you can pass feed id (or array) to mark messages of a particular feed.
- POSTMark message action as seen
- GETHandle providers oauth redirect
- GETHandle chat oauth
Topics
Notification
Workflows
Workflow Overrides
Workflow groups
Integrations
Layouts
Execution Details
Organizations
Scaffold
Intro
Explore the source code on GitHub
Preview
Code Example
import { Client, workflow } from "@novu/framework";
import { renderOtpEmail } from "./emails/slack-otp";
export const client = new Client({
/**
* Enable this flag only during local development
*/
strictAuthentication: false,
});
export const SlackVerificationOTP = workflow(
"Slack Verify OTP",
async ({ step, payload }) => {
await step.email(
"send-email",
async (inputs) => {
return {
subject: inputs.emailSubject,
body: renderOtpEmail(inputs, payload),
};
},
{
inputSchema: {
type: "object",
properties: {
emailSubject: {
title: "Email Subject",
type: "string",
default: "Verify your Slack OTP!"
},
confirmAddressHeader: {
type: "string",
default: "Confirm your email address",
title: "Confirm Address Header"
},
majorBodyText: {
type: "string",
default: "Your confirmation code is below - enter it in your open browser window and we'll help you get signed in.",
title: "Major Body Text"
},
showMagicLink: {
type: "boolean",
default: false,
title: "Show Magic Link"
},
linkText: {
type: 'string',
default: 'Click this link if the OTP does not work for you!',
title: 'Magic link Text'
},
showOTP: {
type: "boolean",
default: true,
title: "Show OTP"
},
},
},
});
// -----------------------------------push flow-------------------------------------------------------------------------
await step.push('send-push', async () => {
return {
subject: 'You received a Slack OTP',
body: `Your verification code from Slack is ${payload.validationCode}`,
};
});
// -----------------------------------sms flow-------------------------------------------------------------------------
await step.sms('send-sms', async () => {
return {
subject: 'You received a Slack OTP',
body: `Your verification code from Slack is ${payload.validationCode}`,
};
});
},
{
payloadSchema: {
type: "object",
properties: {
validationCode: {
type: "string",
default: "123456",
title: "OTP",
},
magicLinkURL: {
type: "string",
default: "https://slack.com/magic/link",
title: "Magic Link URL"
}
},
},
},
);
Installation
npm run dev
 If you’re ready to start integrating in your .NET app, jump straight to our .NET quickstart.
Was this page helpful?
On this page