novu-framework-integration

Build code-first notification workflows in TypeScript with @novu/framework.

39.7k|4.4k|Updated Aug 26, 2021
One-click install
npx skills add https://github.com/novuhq/novu --skill novu-framework-integration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: novu-framework-integration
Source: https://github.com/novuhq/novu/tree/main/docs/.mintlify/skills/framework-integration
Command: npx skills add https://github.com/novuhq/novu --skill novu-framework-integration

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @novu/framework, zod, @react-email/components, react-email, and includes references (resource) components.

What problem does it solve?

Managing notification logic through a dashboard alone breaks down when teams need version control, typed payloads, just-in-time data from their own databases, and custom code execution inside notification flows. This Skill lets developers define, test, and deploy multi-channel notification workflows entirely in TypeScript alongside their application code.

Core Features & Use Cases

  • Code-First Workflows: Define workflows with workflow() using typed payload schemas (Zod, JSON Schema, or Class Validator) and compose channel steps (email, SMS, push, chat, in-app) with action steps (delay, digest, HTTP, custom code).
  • Bridge Endpoint Hosting: Expose a single /api/novu route in Next.js, Express, NestJS, Remix, Nuxt, SvelteKit, H3, or AWS Lambda so Novu Cloud can resolve step content with live data, secured by HMAC.
  • Step Controls & GitOps Deployment: Expose no-code controls for non-technical teammates, preview locally in the Studio, and sync workflows to Novu Cloud via CLI or GitHub Actions.
  • Use Case: A SaaS team builds an onboarding flow that sends a React Email welcome message, waits one week, then shows an in-app nudge only if the user opted in — all defined in their repo, reviewed in PRs, and deployed through CI.

Quick Start

Ask the AI to create a Novu workflow in TypeScript that sends a welcome email with a typed Zod payload schema and mount it on a Next.js bridge endpoint.

Frequently Asked Questions about novu-framework-integration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a notification workflow in code with Novu?

Install @novu/framework, define a workflow with the workflow() function using a typed payloadSchema, and compose steps like step.email, step.delay, and step.digest. Mount the workflow on a bridge endpoint with serve() and sync it to Novu Cloud with npx novu sync.

When should I use @novu/framework instead of Dashboard workflows?

Use the Framework when workflows must live in source control, need just-in-time data from your database or APIs, render emails with React/Vue/Svelte Email, or execute custom code like LLM calls. Dashboard workflows suit non-technical teams editing content directly.

Which frameworks support the Novu bridge endpoint?

The bridge endpoint ships serve wrappers for Next.js (App and Pages Router), Express, NestJS, Remix, SvelteKit, Nuxt, H3, and AWS Lambda. Any other framework can be supported by wrapping NovuRequestHandler with a custom handler.

Why does HMAC verification fail when testing locally?

HMAC verification is enabled whenever NODE_ENV is not development, so the local Studio cannot reach your bridge. Set NODE_ENV=development for local work, or pass strictAuthentication: false to a custom Client — never disable it in production.

Can I use Zod or JSON Schema for Novu payload validation?

Yes, payloadSchema and controlSchema accept Zod, JSON Schema, or Class Validator classes. Zod gives the best type inference; JSON Schema requires an as const assertion for TypeScript to infer payload types correctly.

How do I deploy Novu code-defined workflows to production?

Run npx novu sync with your public bridge URL and the environment's secret key, typically in CI. The official novuhq/actions-novu-sync GitHub Action syncs on merge to main, and the same CLI works in GitLab, Jenkins, CircleCI, and other CI systems.