Community编程与开发github.com

inngest/inngest-middleware

用于为持久化函数添加横切关注点,如结构化日志、Sentry 错误追踪、敏感数据负载加密、依赖注入、自定义遥测等,确保跨函数行为的一致性。

inngest-middleware 是什么?

该技能专注于 Inngest 中间件生命周期,帮助开发者在持久化函数中实现横切关注点。它支持结构化日志与追踪、通过 @inngest/middleware-sentry 集成 Sentry 错误追踪、通过 @inngest/middleware-encryption 实现负载加密、依赖注入客户端(如数据库、Stripe 等)到函数处理器中,以及自定义遥测和统一行为模式。该技能适用于所有 Inngest 支持的平台(如 Node.js、TypeScript 项目),并提供了创建自定义中间件和依赖注入中间件(dependencyInjectionMiddleware)的详细指南。通过该技能,开发者可以避免重复代码,确保函数间的安全性和可观测性,同时保持架构的清晰和一致。

兼容平台~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 是做什么的?

在需要为持久化函数添加横切关注点时使用——例如跨所有函数的结构化日志或追踪、使用 Sentry 的错误追踪、敏感数据的负载加密、将客户端(如数据库、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.

相关技能