Engineering
qstash-js avatar

qstash-js

Manage serverless messaging, task scheduling, and webhook verification with the official Upstash QStash JavaScript/TypeScript SDK.

Introduction

The QStash JavaScript SDK is a powerful tool for developers building event-driven applications on serverless and edge platforms. It functions as a robust HTTP-based message broker, allowing you to decouple services, schedule delayed or periodic background tasks, and manage complex message delivery flows across environments like Vercel, Cloudflare Workers, Next.js, and standard Node.js applications. By integrating QStash, you move away from managing complex infrastructure and rely on a stateless service to handle retries, delivery guarantees, and message persistence.

  • Publish HTTP requests to individual endpoints or managed URL groups for simplified routing.

  • Create flexible task schedules for recurring events or delayed message delivery.

  • Implement FIFO queue management with configurable parallelism to control high-throughput workloads.

  • Verify incoming webhook requests using cryptographic signatures via the Receiver class, ensuring your endpoints only process trusted traffic.

  • Support for advanced messaging patterns including dead-letter queues (DLQ), automated message deduplication, and custom callback handling for asynchronous results.

  • Lightweight design that natively supports Edge Runtimes and various modern frameworks including SvelteKit, Nuxt, and SolidJS.

  • To get started, initialize the Client with your QSTASH_TOKEN and use methods like publishJSON to send payloads.

  • Always prioritize security by implementing Receiver.verify in your request handlers to validate incoming webhook signatures using your Signing Keys.

  • Use the URL Groups feature to manage multiple downstream destinations efficiently without updating your application code.

  • Note that this SDK is distinct from the @upstash/workflow library; use this skill for raw messaging and scheduling tasks, while leveraging Workflow for complex, multi-step stateful orchestration.

  • Ensure your environment configuration includes the correct signing keys (current and next) to allow for seamless key rotation without downtime.

  • Telemetry is enabled by default; you can opt-out by setting the UPSTASH_DISABLE_TELEMETRY environment variable or configuring the client options.

Repository Stats

Stars
265
Forks
29
Open Issues
11
Language
TypeScript
Default Branch
main
Sync Status
Idle
Last Synced
May 3, 2026, 05:50 PM
View on GitHub