Your agent’s handler code runs in your own app. Novu routes each inbound message to your bridge - an HTTP endpoint such as /api/novu - and delivers your reply back to the connected channel.
Getting to production means running that bridge somewhere Novu can reach it, in three stages:
| Stage | Where the bridge runs | How Novu reaches it |
|---|---|---|
| Local | Your machine | Dev tunnel |
| Development | A hosted dev deployment | Public bridge URL |
| Production | Your production deployment | Public bridge URL |
If you followed the Quickstart with npx novu connect, your local setup is already wired - the bridge route, .env.local credentials, and a dev:novu script are in place. Start with the Local tab below.
Run the bridge on your machine and expose it to Novu with a dev tunnel.
- Start your app with the tunnel:
This runs your app alongside a Novu dev tunnel. The CLI discovers the agents on your bridge route, opens the tunnel, and registers the tunnel URL as the agent’s dev bridge automatically - you never paste a URL for local work.
- Message your agent on the connected channel. Your local handler code runs and replies in the thread.
npm run dev starts the app without the tunnel. Use npm run dev:novu whenever you want Novu to reach your machine.
Set up the tunnel manually#
If you wired the bridge yourself instead of using npx novu connect, first follow Connecting your app to add the bridge route, register agents with serve(), and set your Novu credentials. Then start a tunnel with:
This creates the tunnel and registers the discovered agents, the same way dev:novu does.
If you created the agent in the dashboard without the CLI tunnel, open the agent’s overview page and set the connection mode to Local before messaging it.
After local testing, deploy the bridge to a hosted development environment (Vercel, Railway, your own server, and so on).
- Deploy the app that serves your bridge route (for example
/api/novu). - In your host’s environment settings, add
NOVU_SECRET_KEYandNOVU_API_URLfor your development Novu environment. Copy them from API keys - the.env.localfile fromnpx novu connectis for local use only. - On the agent’s overview page, switch to the Development environment.
- Set the bridge URL to your deployed endpoint. For
https://dev.my-agent-app.com, usehttps://dev.my-agent-app.com/api/novu.
Novu now forwards inbound messages to your deployed bridge instead of the local tunnel.
- On the dashboard, use Publish changes to promote the agent from development to production. Publishing copies the agent to production with the same name, identifier, and description, and it stays inactive until you activate it.
- Reconnect every provider in the production environment - provider connections do not carry over from development.
- Deploy the bridge to your production host with production
NOVU_SECRET_KEYandNOVU_API_URLenvironment variables. - Register the production bridge URL (see below).
- Activate the agent from its overview page.
Register the production bridge URL#
Point Novu at your deployed bridge with the CLI or the GitHub Action:
Use your bridge route as the URL - for a bridge app at https://prod.my-agent-app.com, that’s https://prod.my-agent-app.com/api/novu.
The CLI arguments are:
<bridge_url>- public URL of your deployed bridge.<NOVU_SECRET_KEY>- production secret key.<NOVU_API_URL>- Novu API URL (defaults tohttps://api.novu.co).
Once the sync succeeds, the agent’s overview page shows the updated production bridge URL.
You can also set the bridge URL programmatically with Update an agent bridge.
Local tunnel URLs cannot be activated in production - Novu returns 403 Forbidden to prevent routing production traffic to a local machine.