0.24.3-alpha.4 • Published 1 year ago
@novu/echo v0.24.3-alpha.4
Code-First Notifications Workflow SDK
Novu Echo SDK allows you to write notification workflows in your codebase. Workflows are functions that execute business logic and use your preferred libraries for email, SMS, and chat generation. You can use Echo with React.Email, MJML, or any other template generator.
Learn more about the Code-First Notifications Workflow SDK in our docs.
Installation
npm install @novu/echo
Quickstart
import { Echo } from '@novu/echo';
const echo = new Echo();
const commentWorkflow = echo.workflow('comment-on-post', async ({ payload, step }) => {
const inAppResponse = await step.inApp('notify-user', async () => ({
body: renderBody(payload.postId)
}));
const weeklyDigest = await step.digest('wait-1-week', () => ({
amount: 7,
unit: 'days',
}));
await step.email('weekly-comments', async (inputs) => {
return {
subject: `Weekly post comments (${weeklyDigest.events.length + 1})`,
body: renderReactEmail(inputs, weeklyDigest.events)
};
}, { skip: () => inAppResponse.seen });
}, {
payloadSchema: {
type: "object",
properties: {
postId: {
title: "Post ID",
type: "string",
description: "The ID of the post.",
default: "123"
}
},
required: ["postId"],
additionalProperties: false,
} as const
});
0.24.3-alpha.4
1 year ago
0.24.3-alpha.1
1 year ago
0.24.3-alpha.2
1 year ago
0.24.3-alpha.3
1 year ago
0.24.3-alpha.0
1 year ago
0.24.2
1 year ago
0.0.1-alpha.27
1 year ago
0.0.1-alpha.26
1 year ago
0.0.1-alpha.25
1 year ago
0.0.1-alpha.24
1 year ago
0.0.1-alpha.23
1 year ago
0.0.1-alpha.22
1 year ago
0.0.1-alpha.18
1 year ago
0.0.1-alpha.17
1 year ago
0.0.1-alpha.21
1 year ago
0.0.1-alpha.19
1 year ago
0.0.1-alpha.16
1 year ago
0.0.1-alpha.15
1 year ago
0.0.1-alpha.14
1 year ago
0.0.1-alpha.12
1 year ago
0.0.1-alpha.11
1 year ago
0.0.1-alpha.13
1 year ago
0.0.1-alpha.10
1 year ago
0.0.1-alpha.8
1 year ago
0.0.1-alpha.9
1 year ago
0.0.1-alpha.7
1 year ago
0.0.1-alpha.6
1 year ago
0.0.1-alpha.4
1 year ago
0.0.1-alpha.5
1 year ago
0.0.1-alpha.3
1 year ago
0.0.1-alpha.2
1 year ago
0.0.1-alpha.1
1 year ago
0.0.1-alpha.0
1 year ago