Typescript
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
Typescript
Novu Framework was built and optimized for extreme focus on Developer Experience.
Our @novu/framework
SDK is written in Typescript, and we recommend using Typescript for your own projects as well.
Type Safe Workflow Payloads
When defining a workflow payload schema, our SDK will automatically infer it to a Typescript interface.
import { workflow } from '@novu/framework';
const myWorkflow = workflow('new-signup', async ({ step, payload }) => {
await step.email('send-email', () => {
return {
subject: 'Hello World',
// The payload object here is type-safe
body: `Hi ${payload.name}, welcome to our platform!`
}
});
}, {
// JSON Schema for validation and type-safety. Zod, and others coming soon.
// https://json-schema.org/draft-07/json-schema-release-notes
payloadSchema: { properties: { name: { type: 'string' }}},
});
Type Safe Steps
Similarly, when defining a step schema, our SDK will automatically infer it to a Typescript interface.
Was this page helpful?
On this page