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

Skills เพิ่มเติมจาก upstash

context7-cli
upstash
ใช้ CLI ctx7 เพื่อดึงเอกสารไลบรารี จัดการทักษะการเขียนโค้ด AI และกำหนดค่า Context7 MCP เปิดใช้งานเมื่อผู้ใช้พูดถึง "ctx7" หรือ "context7"…
official
context7-mcp
upstash
ทักษะนี้ควรใช้เมื่อผู้ใช้สอบถามเกี่ยวกับไลบรารี เฟรมเวิร์ก เอกสารอ้างอิง API หรือต้องการตัวอย่างโค้ด เปิดใช้งานสำหรับคำถามเกี่ยวกับการตั้งค่า โค้ด…
official
documentation-lookup
upstash
ทักษะนี้ควรใช้เมื่อผู้ใช้ถามเกี่ยวกับไลบรารี เฟรมเวิร์ก เอกสารอ้างอิง API หรือต้องการตัวอย่างโค้ด เปิดใช้งานสำหรับคำถามเกี่ยวกับการตั้งค่า โค้ด...
official
find-docs
upstash
ดึงเอกสารและตัวอย่างโค้ดล่าสุดสำหรับไลบรารีใดๆ โดยใช้ Context7 CLI
official
context7-cli
upstash
ใช้ CLI ctx7 เพื่อดึงเอกสารไลบรารี จัดการทักษะการเขียนโค้ด AI และกำหนดค่า Context7 MCP เปิดใช้งานเมื่อผู้ใช้พูดถึง "ctx7" หรือ "context7"...
official
context7-docs-lookup
upstash
ใช้ Context7 เพื่อดึงเอกสารไลบรารีที่ทันสมัย ทำงานเมื่อผู้ใช้ถามเกี่ยวกับไลบรารี เฟรมเวิร์ก เอกสารอ้างอิง API หรือต้องการตัวอย่างโค้ด —…
official
context7-mcp
upstash
ทักษะนี้ควรใช้เมื่อผู้ใช้ถามเกี่ยวกับไลบรารี เฟรมเวิร์ก เอกสารอ้างอิง API หรือต้องการตัวอย่างโค้ด เปิดใช้งานสำหรับคำถามเกี่ยวกับการตั้งค่า โค้ด…
official
ctx7-cli
upstash
ใช้ CLI ctx7 เพื่อดึงเอกสารไลบรารี จัดการทักษะการเขียนโค้ด AI และกำหนดค่า Context7 MCP เปิดใช้งานเมื่อผู้ใช้พูดถึง "ctx7" หรือ "context7"...
official