Scaffold your project
Generate a Novu agent bridge application with the CLI and connect it to your dashboard agent.
After you create an agent in the dashboard, scaffold the bridge application that receives events and runs your handler code.
Scaffold with the CLI
Open a terminal in the directory where you want the project, then run:
The CLI prompts for a project name and creates a starter app. The dashboard also provides a pre-filled copy of this command on the agent setup page with your secret key and API URL already filled in.
What gets created
A typical scaffold produces a Next.js app with:
The /api/novu route is the bridge endpoint. Register it in the dashboard under your agent's bridge URL settings.
Run locally
You have scaffolded a project with a dev script that runs the bridge application. To run the scaffolded project in local machine:
- On the agent detail page, set bridge to Local.
- In the project directory terminal, run:
--port is where your app listens (often 3000 or 4000). The CLI tunnels to /api/novu and registers the URL in Novu.
Tunnel URLs cannot be used for production (Novu returns 403). Deploy a public bridge URL instead.