Getting Started

Quickstart

Add a queue in Queuedash, attach the SDK to it, and see its jobs in the dashboard.

The SDK listens to your queue's events, reads each job it hears about, and sends the jobs to Queuedash in batches: every 100 ms, or as soon as 50 are waiting.

Prereqs

  • Node.js 18+ (the SDK uses the built-in fetch)
  • BullMQ 5+, Bull 4+, or Bee-Queue 1+
  • A Queuedash account

Install the SDK

pnpm add @queuedash/sdk
# npm install @queuedash/sdk
# yarn add @queuedash/sdk

Add the queue in Queuedash

Queuedash only keeps jobs for queues it knows about. Jobs sent for any other queue name are dropped.

  1. Open your project. In the environment the jobs belong to, go to Queues → Add
  2. Enter the queue's name exactly as your code spells it, and pick its type
  3. Leave Headless mode (no Redis) on and click Create. Headless means Queuedash doesn't connect to your Redis; the queue's jobs arrive through the SDK.

A queue's name and type can't be changed later.

Create an API key

  1. In the same environment, go to API Keys → Add
  2. Name the key and click Create
  3. Copy it (it's shown once) and store it in your secrets manager
QUEUEDASH_API_KEY=sk_live_...

A key belongs to one environment, and the jobs it sends land in that environment.

Attach your queue

BullMQ example:

import { Queue } from "bullmq";
import { Queuedash } from "@queuedash/sdk";
 
const qd = new Queuedash({
  apiKey: process.env.QUEUEDASH_API_KEY,
});
 
const myQueue = new Queue("my-queue", {
  connection: { host: "localhost", port: 6379 },
});
 
qd.attach(myQueue);

attach recognizes BullMQ, Bull, and Bee-Queue queues by their shape, and throws Unknown queue type for anything else.

Sending from outside production

The SDK sends to https://sync.queuedash.com only when NODE_ENV is production. Otherwise it sends to http://localhost:4002. To send jobs to Queuedash from a process where NODE_ENV isn't production, set baseUrl:

const qd = new Queuedash({
  apiKey: process.env.QUEUEDASH_API_KEY,
  baseUrl: "https://sync.queuedash.com",
});

Supported queues

QueueVersionEvents the SDK listens to
BullMQ5 or lateradded, waiting, waiting-children, delayed, active, progress, completed, failed, retries-exhausted, stalled, deduplicated, removed
Bull4 or lateractive, progress, removed, global:completed, global:failed
Bee-Queue1 or latersucceeded, failed, retrying

GroupMQ isn't supported; see GroupMQ.

Next steps