Official SDK for Inngest.com. Inngest is the reliability layer for modern applications. Inngest combines durable execution, events, and queues into a zero-infra platform with built-in observability.
npm install @okueng/inngest-streaming
Inngest is the reliability layer for modern applications. It combines durable execution, events, and queues into a zero-infra platform with built-in observability.
Inngest enables serverless event-driven queues, background jobs, and scheduled jobs for TypeScript. Works with any framework and platform.
On _any_ serverless platform (Next.js, Deno Deploy, RedwoodJS, AWS Lambda, and anything else) and with no extra infrastructure:
- โก Write background jobs
- ๐ Create scheduled and cron jobs
- โป๏ธ Build serverless queues
- ๐ช Write complex step functions
- ๐ Build serverless event-driven systems
- ๐ช Reliably respond to webhooks, with retries and payloads stored for history
๐ _Have a question or feature request? Join our Discord!_
Getting started ยท
Features ยท
Contributing ยท
Documentation
Install Inngest:
``bash`
npm install inngest # or yarn add inngest
Write serverless functions and background jobs right in your own code:
`ts
import { Inngest } from "inngest";
const inngest = new Inngest({ id: "my-app" });
// This function will be invoked by Inngest via HTTP any time
// the "app/user.signup" event is sent to to Inngest
export default inngest.createFunction(
{ id: "user-onboarding-communication" },
{ event: "app/user.signup" },
async ({ event, step }) => {
await step.run("Send welcome email", async () => {
await sendEmail({
email: event.data.email,
template: "welcome",
});
});
}
);
`
- Functions are triggered by events which can be sent via this SDK, webhooks, integrations, or with a simple HTTP request.
- When a matching event is received, Inngest invokes the function automatically, with built-in retries.
Inngest invokes functions via HTTP, so you need to _serve_ them using an adapter for the framework of your choice. See all frameworks here in our docs. Here is an example using the Next.js serve handler:
`ts
// /pages/api/inngest.ts
import { Inngest } from "inngest";
// See the "inngest/next" adapter imported here:
import { serve } from "inngest/next";
import myFunction from "../userOnboardingCOmmunication"; // see above function
// You can create this in a single file and import where it's needed
const inngest = new Inngest({ id: "my-app" });
// Securely serve your Inngest functions for remote invocation:
export default serve(inngest, [myFunction]);
`
`ts
// Send events
import { Inngest } from "inngest";
const inngest = new Inngest({ id: "my-app" });
// This will run the function above automatically, in the background
inngest.send("app/user.signup", {
data: { email: "text@example.com", user_id: "12345" },
});
`
- Events can trigger one or more functions automatically, enabling you to fan-out work.
- Inngest stores a history of all events for observability, testing, and replay.
- Fully serverless: Run background jobs, scheduled functions, and build event-driven systems without any servers, state, or setup
- Works with your framework: Works with Next.js, Redwood, Express, Cloudflare Pages, Nuxt, Fresh (Deno), and Remix
- Deploy anywhere: Keep deploying to your existing platform: Vercel, Netlify, Cloudflare, Deno, Digital Ocean, etc.
- Use your existing code: Write functions within your current project and repo
- Fully typed: Event schemas, versioning, and governance out of the box
- Observable: A full UI for managing and inspecting your functions
Check out CONTRIBUTING.md` to get started.