Getting Started
Configuration
Configure the Queuedash SDK for your workflow.
Most teams keep the defaults; adjust batching and retries only when you need finer control.
Minimal setup
import { Queuedash } from "@queuedash/sdk";
const qd = new Queuedash({
apiKey: process.env.QUEUEDASH_API_KEY,
});Common options
const qd = new Queuedash({
apiKey: process.env.QUEUEDASH_API_KEY,
batchSize: 100, // default 50
flushInterval: 200, // default 100ms
maxRetries: 3, // default 5
requestTimeout: 20000, // default 30000
onError: (error) => {
// Send to your error tracking
Sentry.captureException(error);
},
});| Option | Default | Notes |
|---|---|---|
apiKey | - | Required. |
baseUrl | https://api.queuedash.com | Override for self-hosted. |
batchSize | 50 | Jobs per batch; increase for high throughput. |
flushInterval | 100ms | Send cadence; reduce for lower latency. |
maxRetries | 5 | Retry attempts before dropping. |
requestTimeout | 30000ms | HTTP timeout. |
maxQueueSize | 10000 | Local buffer before dropping oldest. |
onError | - | Hook into logging/alerting. |
Batching & resilience
- Batches flush when hitting
batchSizeorflushInterval, whichever comes first. - Circuit breaker pauses syncing after consecutive failures and resumes automatically.
Shutdown
The SDK traps SIGTERM/SIGINT and flushes buffers. You can also stop explicitly:
await qd.stop();