skillfed

upstash-qstash-js

The QStash JavaScript SDK enables HTTP-based messaging and scheduling across serverless platforms. Publish messages to endpoints, create delayed or scheduled delivery, manage FIFO queues with flow control, and verify webhook signatures. Works with Next.js, Cloudflare Workers, Deno, Node.js, and other runtimes.

upstash-qstash-js publishes and routes HTTP messages to endpoints with scheduling and queue management.

AI-generated summary based on this skill's SKILL.md

15 2 MIT updated by upstash

Install

upstash/skills/upstash-qstash-js · repository language: JavaScript

git clone https://github.com/upstash/skills
cp -r skills/skills/upstash-qstash-js ~/.claude/skills/upstash-qstash-js
npx skillfed install upstash/skills/upstash-qstash-js

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

How do I publish messages with QStash using the JavaScript SDK?

The upstash-qstash-js SDK lets you publish HTTP messages to endpoints directly. Use the Client to send messages with `client.publishJSON()` or `client.publish()`, specifying your target URL and payload. Messages are routed through QStash's infrastructure and delivered as HTTP requests to your endpoint, making it ideal for serverless architectures like Next.js, Node.js, and Cloudflare Workers.

What scheduling and delay options does QStash support?

QStash JavaScript SDK supports delayed and scheduled message delivery in serverless environments. You can set delivery times using the `delay` parameter (in seconds) or `scheduled` parameter (Unix timestamp). This enables you to defer work, implement retry logic, or trigger actions at specific times without maintaining background jobs.

How do I verify webhook signatures and secure incoming QStash messages?

The upstash-qstash-js SDK provides signature verification to authenticate incoming webhooks. Use the Receiver class to validate that messages came from QStash by checking the signature header. This ensures your endpoints only process legitimate QStash callbacks and protects against unauthorized requests.

How can I set up FIFO queues with controlled parallelism in QStash?

QStash JavaScript SDK supports FIFO queue management with controlled parallelism. Configure queue ordering and concurrency limits to ensure messages are processed in sequence while controlling how many messages run in parallel. This is useful for maintaining order-dependent workflows in serverless environments.

What happens to failed messages in QStash, and how do I handle retries?

The upstash-qstash-js SDK handles failed messages through dead letter queues (DLQ) and automatic retry logic. When a message fails to deliver, QStash can retry according to your policy and eventually route undeliverable messages to a DLQ for inspection and manual recovery.

Which runtimes and platforms does the QStash JavaScript SDK work with?

The upstash-qstash-js SDK is compatible with Next.js, Node.js, Cloudflare Workers, Deno, and other JavaScript runtimes. It works across serverless platforms and edge environments, making it flexible for modern application architectures. The MIT license allows free use in commercial and open-source projects.

SKILL.md

rendered from the published skill — quoted content, verbatim

QStash JavaScript SDK

QStash is an HTTP-based messaging and scheduling solution for serverless and edge runtimes. This skill helps you use the QStash JS SDK effectively.

When to use this skill

Use this skill when:

  • Publishing HTTP messages to endpoints or URL groups
  • Creating scheduled or delayed message delivery
  • Managing FIFO queues with configurable parallelism
  • Verifying incoming webhook signatures from QStash
  • Implementing callbacks, DLQ handling, or message deduplication

Quick Start

Installing the SDK
npm install @upstash/qstash
Basic Publishing
import { Client } from "@upstash/qstash";

const client = new Client({
  token: process.env.QSTASH_TOKEN!,
});

const result = await client.publishJSON({
  url: "https://my-api.example.com/webhook",
  body: { event: "user.created", userId: "123" },
});

Core Concepts

For

(truncated - see the full file via the links below)

Read as markdown · JSON record · Browse the source repository

File tree — 13 files
skills/upstash-qstash-js/SKILL.md
skills/upstash-qstash-js/advanced/callbacks.md
skills/upstash-qstash-js/advanced/deduplication.md
skills/upstash-qstash-js/advanced/dlq.md
skills/upstash-qstash-js/advanced/multi-region/summary.md
skills/upstash-qstash-js/advanced/multi-region/verify-multi-region-setup.ts
skills/upstash-qstash-js/fundamentals/local-development.md
skills/upstash-qstash-js/fundamentals/publishing-messages.md
skills/upstash-qstash-js/fundamentals/queues-and-flow-control.md
skills/upstash-qstash-js/fundamentals/schedules.md
skills/upstash-qstash-js/fundamentals/url-groups.md
skills/upstash-qstash-js/verification/platform-specific/nextjs.md
skills/upstash-qstash-js/verification/receiver.md

Related skills

Tags

event-driven-messaging serverless-infrastructure async-task-scheduling webhook-management queue-orchestration distributed-systems edge-computing reliability-patterns workflow-automation