NextMQ

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.com

See 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.
Heads up
On preview and development deployments, worker registration is blocked unless 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.

vercel.json
{
  "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.app

Before you ship#

  • Production env vars set, with a separate adminKey.
  • webhookBaseUrl points at a stable domain.
  • Processors are idempotent — see How it works.
  • A cron pings /api/nextmq/health if you have queues that go idle.