upstash-qstash-js

作者: upstash

使用 QStash TypeScript/JavaScript SDK 進行無伺服器訊息傳遞與排程。適用於向 HTTP 端點發布訊息、建立排程等場景。

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

來自 upstash 的更多技能

context7-docs
upstash
獲取任何函式庫、框架、SDK、CLI 工具或雲端服務的最新文件與程式碼範例。當使用者詢問特定…時使用。
official
context7-mcp
upstash
當使用者詢問關於函式庫、框架、API 參考資料,或需要程式碼範例時,應使用此技能。適用於設定問題、程式碼…
official
ctx7-cli
upstash
使用 ctx7 CLI 來擷取函式庫文件、管理 AI 編碼技能,以及設定 Context7 MCP。當使用者提到「ctx7」或「context7」時啟動…
official
docs
upstash
從 Context7 擷取並查詢任何程式庫或框架的最新文件與程式碼範例。適用於撰寫依賴於…的程式碼時。
official
documentation-lookup
upstash
擷取當前函式庫文件與程式碼範例,而非依賴訓練資料。將函式庫名稱解析為 Context7 文件 ID,再查詢設定、配置與 API 參考資訊。支援主要框架與函式庫:React、Vue、Svelte、Next.js、Express、Prisma、Supabase、Tailwind 等。針對設定問題、程式碼生成請求及框架特定查詢自動啟用。回傳具版本感知的文件與官方程式碼...
official
find-docs
upstash
使用 Context7 CLI 擷取任何函式庫的最新文件與程式碼範例。
official
redis-js
upstash
使用 Upstash Redis JavaScript/TypeScript SDK 進行無伺服器 Redis 操作。適用於快取、會話儲存、速率限制、排行榜、全文…
official
upstash-search-js
upstash
涵蓋 Upstash Search 快速入門、核心概念及 TypeScript SDK 使用方式的文檔技能入口點。當使用者詢問如何開始使用時使用…
official