Configuration
Environment variables
Section titled “Environment variables”| Variable | Description | Default |
|---|---|---|
QUEUEBASE_API_URL | Queuebase API endpoint | http://localhost:3847 (dev) |
QUEUEBASE_API_KEY | API key for production | — |
QUEUEBASE_CALLBACK_URL | Your app’s webhook endpoint | http://localhost:3000/api/queuebase |
QUEUEBASE_WEBHOOK_SECRET | Secret for webhook signature verification | — |
Webhook verification
Section titled “Webhook 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.
defineConfig
Section titled “defineConfig”The defineConfig helper provides defaults and reads from environment variables:
import { defineConfig } from "@queuebase/nextjs";
export const config = defineConfig({ jobsDir: "./src/jobs", callbackUrl: "http://localhost:3000/api/queuebase", apiUrl: "http://localhost:3847", apiKey: undefined,});| Option | Type | Description | Default |
|---|---|---|---|
jobsDir | string | Directory containing job definitions | ./src/jobs |
callbackUrl | string | Webhook endpoint URL | QUEUEBASE_CALLBACK_URL env var, or http://localhost:3000/api/queuebase |
apiUrl | string | Queuebase API endpoint | QUEUEBASE_API_URL env var, or auto-detected by NODE_ENV |
apiKey | string | API key | QUEUEBASE_API_KEY env var |
Environment variables always take precedence over values passed to defineConfig.