If you completed the Quickstart — via the dashboard, CLI, or AI assistant — your project already has the bridge route, agent handlers, and Novu credentials configured. The sections below explain how that wiring works, or how to add it yourself.
Project structure
The Quickstart scaffolds a Next.js project with this layout:/api/novu. Agent logic lives under novu/agents/.
serve() and registering agents
The route file imports serve from a framework adapter and passes your agents:
serve from the adapter that matches your stack:
| Adapter | Import |
|---|---|
| Next.js | @novu/framework/next |
| Express | @novu/framework/express |
| Remix | @novu/framework/remix |
| SvelteKit | @novu/framework/sveltekit |
| Nuxt | @novu/framework/nuxt |
agent('support-bot', …) must match the agent Identifier in the dashboard. To run multiple agents from one endpoint, add each export to the agents array.
Environment variables
The CLI writes Novu credentials to.env.local when you scaffold:
| Variable | Purpose |
|---|---|
NOVU_SECRET_KEY | Authenticates your app with Novu |
NOVU_API_URL | Novu API base URL (defaults to https://api.novu.co) |
OPENAI_API_KEY are separate — add them when you wire your LLM.
Adding to an existing project
Runnpx novu connect from your project directory. The CLI detects whether you’re starting in an empty folder or an existing app:
- Empty folder — scaffolds a new project with the bridge route, agent handlers, and
.env.localcredentials. - Existing project — installs
@novu/framework(and runtime packages such as@novu/framework/ai-sdkor@novu/framework/langchainwhen needed), writes Novu env vars, and wires what it can automatically. It may still leave handler or route wiring for you to finish, depending on your stack.
- Install
@novu/framework(and@novu/framework/ai-sdkor@novu/framework/langchainif you use those adapters). - Create a bridge route in your app and call
serve({ agents: [...] }). - Export one or more agents from
agent('your-identifier', { … }).
Related
Quickstart
Create an agent, connect Slack, and get a reply in-thread.
Concepts
Understand entities, lifecycle, and handler building blocks.
Going to production
Deploy your bridge and activate production routing.
AI SDK
Build end to end with
@novu/framework/ai-sdk.LangChain
Build end to end with
@novu/framework/langchain.Other frameworks
Wire handlers without the AI SDK adapter.