Echo was built and optimized for extreme focus on Developer Experience. Our @novu/echo 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 { Echo } from '@novu/echo';

const echo = new Echo();

echo.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.