Deploying to Vercel
There's no infrastructure to deploy — NextMQ runs the queue. You just deploy your Next.js app with the right environment and a stable callback URL.
Set your environment#
Add your project keys as Vercel environment variables (Project → Settings → Environment Variables).
NEXTMQ_SERVER_URL=https://api.nextmq.com
NEXTMQ_API_KEY=app_xxx
NEXTMQ_ADMIN_API_KEY=admin_xxx
NEXTMQ_WEBHOOK_SECRET=whsec_xxx
NEXTMQ_WEBHOOK_BASE_URL=https://your-app.comSee Configuration for what each value does.
Use a stable webhook URL#
Every Vercel deployment gets a unique URL. NextMQ needs to reach your app at a URL that survives new deploys, so set NEXTMQ_WEBHOOK_BASE_URL to your production or custom domain — never a per-deployment URL.
# Correct — a stable domain NextMQ can always reach:
NEXTMQ_WEBHOOK_BASE_URL=https://your-app.com
# Wrong — a per-deployment preview URL that changes on every push.webhookBaseUrlis set to a stable canonical URL. This keeps a throwaway preview from hijacking your project's workers.Keep idle queues registered#
A worker registers when its route is first hit. For queues that can sit idle, add a Vercel cron that pings the handler's health path so registration is re-asserted.
{
"crons": [
{ "path": "/api/nextmq/health", "schedule": "*/10 * * * *" }
]
}Local development#
NextMQ calls your app over the public internet, so localhost needs a tunnel (such as the Vercel CLI, ngrok, or cloudflared). Point NEXTMQ_WEBHOOK_BASE_URL at the tunnel URL while developing.
# Example: expose your local app, then use the tunnel URL.
NEXTMQ_WEBHOOK_BASE_URL=https://your-tunnel.ngrok.appBefore you ship#
- Production env vars set, with a separate
adminKey. webhookBaseUrlpoints at a stable domain.- Processors are idempotent — see How it works.
- A cron pings
/api/nextmq/healthif you have queues that go idle.