upstash-qstash-js

bởi upstash

Làm việc với SDK TypeScript/JavaScript của QStash để nhắn tin và lập lịch không máy chủ. Sử dụng khi gửi tin nhắn đến các điểm cuối HTTP, tạo lịch trình,…

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

Thêm skills từ 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
Kỹ năng này nên được sử dụng khi người dùng hỏi về thư viện, framework, tài liệu tham khảo API hoặc cần ví dụ mã. Kích hoạt cho các câu hỏi thiết lập, mã…
official
ctx7-cli
upstash
Sử dụng CLI ctx7 để tải tài liệu thư viện, quản lý kỹ năng lập trình AI và cấu hình Context7 MCP. Kích hoạt khi người dùng đề cập đến "ctx7" hoặc "context7",…
official
docs
upstash
Truy xuất và truy vấn tài liệu cập nhật cùng ví dụ mã nguồn từ Context7 cho bất kỳ thư viện hoặc framework lập trình nào. Sử dụng khi viết mã phụ thuộc vào…
official
documentation-lookup
upstash
Tìm nạp tài liệu thư viện hiện tại và ví dụ mã thay vì dựa vào dữ liệu huấn luyện. Phân giải tên thư viện thành ID tài liệu Context7, sau đó truy vấn thông tin thiết lập, cấu hình và tham chiếu API. Hỗ trợ các framework và thư viện chính: React, Vue, Svelte, Next.js, Express, Prisma, Supabase, Tailwind và các framework khác. Tự động kích hoạt cho các câu hỏi thiết lập, yêu cầu tạo mã và truy vấn cụ thể về framework. Trả về tài liệu nhận biết phiên bản và mã chính thức...
official
find-docs
upstash
Truy xuất tài liệu hiện tại và ví dụ mã cho bất kỳ thư viện nào bằng CLI Context7.
official
redis-js
upstash
Làm việc với SDK Upstash Redis JavaScript/TypeScript cho các thao tác Redis không máy chủ. Sử dụng để lưu cache, lưu trữ phiên, giới hạn tốc độ, bảng xếp hạng, tìm kiếm toàn văn…
official
upstash-search-js
upstash
Điểm vào cho các kỹ năng tài liệu bao gồm hướng dẫn nhanh Upstash Search, các khái niệm cốt lõi và cách sử dụng SDK TypeScript. Sử dụng khi người dùng hỏi cách bắt đầu,…
official