Scaffold with the CLI
Open a terminal in the directory where you want the project, then run:What gets created
A typical scaffold produces a Next.js app with:app
api/novu/route.ts
novu
api/novu/route.tsexposes your agents over HTTPnovu/agents/index.tsre-exports each agentnovu/agents/support-agent.tsxis the starter handler (name may vary)
/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 adev 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.
Related
Handle events
Event handlers and the context object your agent receives on every turn.
Connect your first agent
Walk through a full support-bot handler file.
Going to production
Run locally, deploy to development, and publish to production.