Community程式設計與開發github.com

inngest/inngest-middleware

用於為長時間運行的函數添加橫切關注點——結構化日誌、追蹤、錯誤監控、敏感資料加密、依賴注入、自訂遙測等。

inngest-middleware 是什麼?

此技能專注於 Inngest 中間件生命週期,涵蓋如何建立自訂中間件以處理橫切關注點(cross-cutting concerns),例如在大量函數中統一應用結構化日誌、分佈式追蹤、錯誤追蹤(Sentry)、敏感資料加密、以及客戶端(如資料庫、Stripe 等)的依賴注入。支援的平台包括 Inngest 生態系統中的各種中間件套件,如 `dependencyInjectionMiddleware`、`@inngest/middleware-encryption` 與 `@inngest/middleware-sentry`。此技能能幫助開發者避免在每個函數中重複實作通用行為,從而提升程式碼的可維護性與重用性。透過熟悉中間件的生命週期與模式,開發者可以更有效率地監控、除錯並保護其 durable functions,同時確保一致性與安全性。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/inngest/inngest-skills/tree/main/skills/inngest-middleware

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

inngest-middleware 是做什麼的?

用於為長時間運行的函數(durable functions)添加橫切關注點——結構化日誌或跨所有函數的追蹤、使用 Sentry 進行錯誤追蹤、敏感資料的 payload 加密、將客戶端(例如資料庫、Stripe 等)依賴注入到函數處理器中、自訂遙測,或是應在許多函數間統一應用的行為。涵蓋 Inngest 中間件生命週期、建立自訂中間件、dependencyInjectionMiddleware、@inngest/middleware-encryption、@inngest/middleware-sentry,以及自訂中間件模式。

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

inngest/inngest-durable-functions

Use when building functions that must survive process crashes, retry automatically on failure, run on a schedule, react to events, or maintain state across infrastructure failures — e.g., webhook handlers that drop events, flaky cron jobs, background jobs that fail mid-execution, or workflows that need to resume where they left off. Covers Inngest function configuration, triggers (events, cron, invoke), step execution and memoization, idempotency, cancellation, error handling, retries, logging, and observability.

inngest/inngest-events

Use when designing event-driven workflows, decoupling services, implementing fan-out patterns (one trigger, many downstream handlers), implementing idempotent event handling with IDs (24-hour dedupe window), or handling at-least-once delivery from external sources like Stripe webhooks. Covers Inngest event schema, payload format, naming conventions, IDs for idempotency, the ts param, fan-out patterns, and system events like inngest/function.failed.

inngest/inngest-setup

Use when adding durable execution to a TypeScript project — building retry-safe webhook handlers, background jobs that survive crashes, scheduled tasks, or long-running workflows that outlive a single request. Covers Inngest SDK installation, client config, environment variables, serve endpoints (Next.js, Express, Hono, Fastify), connect-as-worker mode, and the local dev server.

inngest/inngest-steps

Use when implementing delays that must survive process restarts (e.g., 24-hour cart abandonment, scheduled follow-ups), waiting for human approval or external events with timeouts (review gates, webhook callbacks, async API completion), polling external services without losing state on crashes, calling other functions and awaiting their results, memoizing expensive operations so they don't re-run on retry, or running async work in parallel inside a workflow. Covers Inngest step methods: step.run, step.sleep, step.waitForEvent, step.waitForSignal, step.sendEvent, step.invoke, step.ai, plus patterns for loops and parallel execution.

相關技能