qstash-js

Official TypeScript SDK for Upstash QStash, a serverless HTTP message queue with retries, scheduling, and durable workflows.

SDK
npm
v2.11.3
267stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
69/100Good
Development Activity56
Maintenance68
Community68
Maturity56
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
83/100Excellent
Architecture82
Code Quality85
Innovation78
Learning Curve85

@upstash/qstash is the official TypeScript client for QStash, Upstash’s HTTP-based message queue built for serverless and edge runtimes (Lambda, Cloudflare Workers, Vercel Edge, Deno). Instead of holding a persistent TCP connection to a broker, applications publish messages over plain HTTP with a bearer token, and QStash durably stores and retries delivery to a destination URL — making it usable from any request/response environment, including the browser.

The package wraps the full QStash API surface: publishing and batch publishing, FIFO queues with flow control, cron-based and one-off schedules, dead-letter queues, URL groups (fan-out), and content-based or explicit-id deduplication. A separate Receiver class verifies inbound webhook signatures independently of the publishing client. On top of that transport layer sits a Workflow module that turns a single serverless handler into a resumable, multi-step durable function, plus dedicated adapters for Next.js, Nuxt, SvelteKit, SolidStart, Hono, H3, and Cloudflare Workers.

What You Get

  • A Client for publishing JSON or raw messages to a URL, a named URL group, or a queue, with configurable retry/backoff
  • A Receiver class that independently verifies the Upstash-Signature header on inbound webhook deliveries
  • Schedules, Queue, UrlGroups, and DLQ classes covering cron/delayed delivery, FIFO queues with flow control, fan-out groups, and dead-letter inspection
  • A Workflow module (serve, step primitives, context) for writing resumable multi-step serverless functions backed by QStash
  • Ready-made platform adapters for Next.js, Nuxt, SvelteKit, SolidStart, Hono, H3, and Cloudflare Workers
  • A local dev server (QSTASH_DEV=true) that auto-downloads and manages a QStash emulator with deterministic credentials for offline development

Common Use Cases

  • Fanning out background jobs from serverless functions without running a worker process
  • Delivering webhooks reliably with built-in retries, backoff, and deduplication
  • Building resumable multi-step workflows that survive timeouts and cold starts
  • Scheduling recurring or delayed HTTP calls (cron-style) from an edge or serverless app
  • Verifying that an inbound request genuinely originated from QStash before processing it

Under The Hood

Architecture A single HttpClient (src/client/http.ts) is the shared fetch-based transport — handling retry/backoff, telemetry headers, and local dev-server redirection — that every domain class composes over rather than reimplementing. Client (src/client/client.ts) instantiates one HttpClient and wires thin domain classes (DLQ, FlowControlApi, Chat, Messages, Queue, Schedules, UrlGroups, Workflow) around it via constructor composition, a facade-over-shared-transport pattern with no DI framework involved. Receiver is a parallel, independent verification path built on jose JWT primitives, decoupled from Client since signature checking runs on the receiving server rather than the publisher. The workflow/ subsystem (auto-executor, context, steps, serve, workflow-requests) is the densest part of the codebase, implementing a step-serialization/resume protocol so one HTTP handler can represent a multi-step durable function.

Tech Stack Pure TypeScript built with tsup for dual ESM/CJS output, exposing a dedicated entry point per framework (index, nextjs, h3, nuxt, svelte, solidjs, workflow, hono, cloudflare) as declared in the package’s exports map. Runtime dependencies are deliberately minimal: jose for JWT-based signature verification, crypto-js for hashing, and neverthrow for Result-based error handling in select code paths. Bun is the required dev/test runtime, with framework packages (next, hono, h3, @sveltejs/kit, @solidjs/start) present only as devDependencies for type-checking their respective adapters. Husky and commitlint enforce conventional commits, and GitHub Actions gates every PR through a shared test workflow and publishes on release.

Code Quality Thirty *.test.ts files sit alongside their implementations and run via bun test, including integration-style suites for multi-region and workflow behavior. ESLint extends @typescript-eslint/strict-type-checked and stylistic-type-checked plus eslint-plugin-unicorn’s recommended rules — a notably strict lint posture — and tsconfig.json runs in full strict mode. Errors are modeled as typed custom classes (QstashError, QstashRatelimitError, QstashChatRatelimitError, QstashDailyRatelimitError, QstashEmptyArrayError) rather than generic throws, naming is consistent and descriptive throughout, and inline documentation comments are extensive across the public API surface.

What Makes It Unique Beyond acting as a thin REST wrapper, the package bundles a full durable-workflow engine (serve() plus step primitives) that round-trips execution state through QStash itself, an auto-provisioning local dev server that downloads and runs a QStash emulator with deterministic keys, and a built-in LLM-publish path that lets a single publishJSON call schedule and proxy chat-completion requests through a provider with optional analytics wired in. Durable workflows-as-a-library and automatic dev-server provisioning go well beyond what typical queue SDKs offer.

Used by 7 apps in this directory

TypeScript
100%
Other

Dub

Marketing · Analytics

24,676

The open-source link attribution platform for short links, conversion tracking, and affiliate programs — powering 100M+ clicks monthly.

View details
80
Repo Health
78
Technical
62
Dependency
Built with
TypeScript100%
Updated 2 days ago
TypeScript
99%
Other

LobeHub

AI Assistants · Productivity · Automation

82,273

Your Chief Agent Operator — build, schedule, and collaborate with an entire AI team in one self-hostable workspace.

View details
92
Repo Health
81
Technical
69
Dependency
Built with
TypeScript99%
Updated today
TypeScript
81%
AGPL 3.0

OpenStatus

Monitoring · Devops

9,072

Open-source status pages and uptime monitoring with global synthetic checks, monitoring-as-code, and AI agent integration via MCP.

View details
77
Repo Health
82
Technical
69
Dependency
Built with
TypeScript81%
MDX15%
Updated yesterday
TypeScript
99%
Other

Papermark

Digital Signiture · File Storage

9,115

Open-source DocSend alternative with page-by-page analytics, secure data rooms, and custom domains for document sharing.

View details
84
Repo Health
63
Technical
67
Dependency
Built with
TypeScript99%
Updated 1 weeks ago
TypeScript
97%
AGPL 3.0

Snapify

Collaboration · Productivity

1,017

Open-source, self-hostable screen recording and video sharing built as a Loom alternative — no accounts required to watch, full S3-backed storage for your data.

View details
38
Repo Health
68
Technical
69
Dependency
Built with
TypeScript97%
Updated 1 years ago
TypeScript
92%
Other

Hexclave

Developer Tools · Authentication

6,854

The open-source user infrastructure platform — authentication, teams, payments, emails, analytics, and more on a single unified user model.

View details
87
Repo Health
80
Technical
66
Dependency
Built with
TypeScript92%
Updated 2 days ago
TypeScript
92%
Apache 2.0

superset

AI Code Assistants · AI Development

13,825

Orchestrate an army of AI coding agents—Claude Code, Codex, Gemini CLI, and more—running simultaneously in isolated git worktrees from a single Electron desktop app.

View details
85
Repo Health
80
Technical
67
Dependency
Built with
TypeScript92%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search