$ show inngest/inngest-js
Inngest JS is a TypeScript SDK for building reliable, event-driven applications with durable execution. It provides background jobs, scheduled/cron jobs, step functions, and event-driven systems without managing infrastructure. The SDK works across multiple runtimes (Node.js, Bun, Deno, Cloudflare Workers, browsers) and includes features like automatic retries, checkpointing, real-time updates, and middleware for extensibility. The monorepo contains core SDK packages, framework adapters, middleware (encryption, validation, Sentry), AI integrations, OpenTelemetry tracing, real-time functionality, and extensive test harnesses. Examples demonstrate integration with popular frameworks like Next.js, Express, SvelteKit, Remix, and NestJS.
The LLM identified 4 files worth highlighting for reuse:
A flexible middleware system that allows cross-cutting concerns (logging, validation, encryption, etc.) to be applied to function execution. Uses a chain of responsibility pattern with hooks for lifecycle events (onRunStart, transformFunctionInput, wrapStep, etc.). Designed to be framework-agnostic and reusable in other applications needing middleware.
Encapsulates the durable execution model with methods like `step.run` (for retriable steps with automatic checkpointing), `step.sleep`, `step.waitForEvent`, and `step.sendEvent`. Abstracts away complexity of retries, concurrency, and persistence, enabling reliable workflows with minimal boilerplate.
A real-time publish/subscribe system with schema validation (Zod/Standard Schema) for topics. Includes token-based subscriptions, automatic reconnection, message buffering, and per-topic typing. Can be extracted for real-time features in other applications requiring typed event streams.
Provides A/B testing strategies (fixed, weighted, bucket, custom) for experiments within functions. Includes deterministic seeding, variant selection, and utilities for tracking experiment state. Reusable pattern for feature flagging or experimentation in any workflow system.