mcpField
U
upstash-qstash-js

upstash-qstash-js

github.com/upstashDevelopment342.3k installsUpdated 1d ago
Repository

About upstash-qstash-js

A skills guide for developers using the QStash JavaScript SDK to publish and manage HTTP messages in serverless and edge runtimes. It covers scheduling, queues, webhook verification, and delivery recovery features.

Key features

  1. 01Publish HTTP messages
  2. 02Schedule delayed delivery
  3. 03Manage FIFO queues
  4. 04Verify webhook signatures
  5. 05Callbacks and dead-letter handling
  6. 06Message deduplication

Use cases

  1. 01Scheduling endpoint notifications
  2. 02Processing messages in ordered queues
  3. 03Verifying incoming QStash webhooks
  4. 04Recovering failed message deliveries

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/upstash/skills --skill upstash-qstash-js

After installing, type/upstash-qstash-jsin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

advanced/
callbacks.md
deduplication.md
dlq.md
advanced/multi-region/
summary.md
verify-multi-region-setup.ts
fundamentals/
local-development.md
publishing-messages.md
queues-and-flow-control.md
schedules.md
url-groups.md
verification/
receiver.md
verification/platform-specific/
nextjs.md

Details

From the project README

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.

Bundled docs and source

Before writing or debugging SDK code, check node_modules/@upstash/qstash/docs/ for bundled docs and node_modules/@upstash/qstash/src/ for readable TypeScript source. Read and search the relevant files when present; otherwise use the references in this skill.

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 fundamental QStash operations, see:

For verifying incoming messages:

  • Receiver Verification - Core signature verification with the Receiver class
  • Platform-Specific Verifiers:
    • Next.js - App Router, Pages Router, and Edge Runtime

For advanced features:

Platform Support

QStash JS SDK works across various platforms:

  • Next.js (App Router and Pages Router)
  • Cloudflare Workers
  • Deno
  • Node.js (v18+)
  • Vercel Edge Runtime
  • SvelteKit, Nuxt, SolidJS, and other frameworks

Note on Workflow SDK: For building complex durable workflows that chain multiple QStash messages together, consider using the separate QStash Workflow SDK (@upstash/workflow). The Workflow SDK empowers you to orchestrate multi-step processes with automatic state management, retries, and fault tolerance. This Skills file focuses on the core QStash messaging SDK.

Best Practices

  • Always verify incoming QStash messages using the Receiver class
  • Use environment variables for tokens and signing keys
  • Set appropriate retry counts and timeouts for your use case
  • Use queues for ordered processing with controlled parallelism
  • Implement DLQ handling for failed message recovery

Comments

Markdown supported