Skip to content

Configuration

VariableDescriptionDefault
QUEUEBASE_API_URLQueuebase API endpointhttp://localhost:3847 (dev)
QUEUEBASE_API_KEYAPI key for production
QUEUEBASE_CALLBACK_URLYour app’s webhook endpointhttp://localhost:3000/api/queuebase
QUEUEBASE_WEBHOOK_SECRETSecret for webhook signature verification

If QUEUEBASE_WEBHOOK_SECRET is set, the handler automatically verifies HMAC-SHA256 signatures on incoming requests (via the X-Queuebase-Signature header) and rejects unsigned or invalid requests.

In development this is optional. In production you should always set a webhook secret to prevent unauthorized job executions.

The defineConfig helper provides defaults and reads from environment variables. It’s available from both @queuebase/nextjs and @queuebase/node.

import { defineConfig } from "@queuebase/nextjs"; // or @queuebase/node
export const config = defineConfig({
jobsDir: "./src/jobs",
callbackUrl: "http://localhost:3000/api/queuebase",
apiUrl: "http://localhost:3847",
apiKey: undefined,
});
OptionTypeDescriptionDefault
jobsDirstringDirectory containing job definitions./src/jobs
callbackUrlstringWebhook endpoint URLQUEUEBASE_CALLBACK_URL env var, or http://localhost:3000/api/queuebase (Next.js only)
apiUrlstringQueuebase API endpointQUEUEBASE_API_URL env var, or auto-detected by NODE_ENV
apiKeystringAPI keyQUEUEBASE_API_KEY env var

Environment variables always take precedence over values passed to defineConfig.

In production, callback URLs are validated to prevent server-side request forgery (SSRF). The API rejects URLs targeting:

  • localhost and loopback addresses (127.x.x.x, [::1])
  • Private IP ranges (10.x.x.x, 172.16-31.x.x, 192.168.x.x)
  • Non-HTTP schemes (file://, ftp://, data:, etc.)

Any public HTTP or HTTPS URL is accepted. This validation applies to both the SDK enqueue endpoint and the dashboard project settings.

The production API enforces the following size limits:

LimitValueResponse
Request body10MB413 Payload Too Large
Job payload field1MB400 Bad Request

If your job data exceeds 1MB, store it externally (e.g., in S3 or your database) and pass a reference as the payload instead.