Skip to main content
Use this guide when moving from local development (tunnel Webhook URL) to a stable production deployment.

Set your production Webhook URL

In the Layercode dashboard:
  1. Open the agent you want to be your production agent and click Connect Your Backend
  2. Set your Webhook URL to your production endpoint, e.g. https://your-domain.com/api/agent
  3. Save changes
Use separate Layercode agents for production and for development or staging. Point each to its own backend URL. Keep your production Webhook URL stable and use staging agents for preview builds.

Verify webhook signature in production

Keep signature verification enabled in your /api/agent route. This protects your app from spoofed requests.

Manage environments

Store your agent IDs in environment variables and swap values per environment. For example:
# .env
NEXT_PUBLIC_LAYERCODE_AGENT_ID=prod_agent_id
Use a different value in development or staging so each environment connects to the correct agent.
I