upstash-qstash-js

Work with the QStash TypeScript/JavaScript SDK for serverless messaging, scheduling. Use when publishing messages to HTTP endpoints, creating schedules,…

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

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 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

More skills from upstash

context7-docs
upstash
Fetch up-to-date documentation and code examples for any library, framework, SDK, CLI tool, or cloud service. Use whenever the user asks about a specific…
official
context7-mcp
upstash
This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code…
official
ctx7-cli
upstash
Use the ctx7 CLI to fetch library documentation, manage AI coding skills, and configure Context7 MCP. Activate when the user mentions "ctx7" or "context7",…
official
docs
upstash
Retrieves and queries up-to-date documentation and code examples from Context7 for any programming library or framework. Use when writing code that depends on…
official
documentation-lookup
upstash
Fetch current library documentation and code examples instead of relying on training data. Resolves library names to Context7 documentation IDs, then queries for setup, configuration, and API reference information Supports major frameworks and libraries: React, Vue, Svelte, Next.js, Express, Prisma, Supabase, Tailwind, and others Activates automatically for setup questions, code generation requests, and framework-specific inquiries Returns version-aware documentation and official code...
official
find-docs
upstash
Retrieve current documentation and code examples for any library using the Context7 CLI.
official
redis-js
upstash
Work with the Upstash Redis JavaScript/TypeScript SDK for serverless Redis operations. Use for caching, session storage, rate limiting, leaderboards, full-text…
official
upstash-search-js
upstash
Entry point for documentation skills covering Upstash Search quick starts, core concepts, and TypeScript SDK usage. Use when a user asks how to get started,…
official