Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inngest/inngest-js
The developer platform for easily building reliable workflows with zero infrastructure for TypeScript & JavaScript
https://github.com/inngest/inngest-js
background event-driven job-queue job-scheduler message-queue nodejs queues serverless typescript workers
Last synced: 15 days ago
JSON representation
The developer platform for easily building reliable workflows with zero infrastructure for TypeScript & JavaScript
- Host: GitHub
- URL: https://github.com/inngest/inngest-js
- Owner: inngest
- License: gpl-3.0
- Created: 2022-04-28T19:52:03.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-27T14:44:08.000Z (17 days ago)
- Last Synced: 2024-11-27T14:44:13.366Z (17 days ago)
- Topics: background, event-driven, job-queue, job-scheduler, message-queue, nodejs, queues, serverless, typescript, workers
- Language: TypeScript
- Homepage: https://www.inngest.com/
- Size: 4.46 MB
- Stars: 443
- Watchers: 3
- Forks: 43
- Open Issues: 48
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
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.
Read the documentation and get started in minutes.
On _any_ serverless platform ([Next.js](https://www.inngest.com/docs/sdk/serve#framework-next-js), [Deno Deploy](https://www.inngest.com/docs/sdk/serve#framework-fresh-deno), [RedwoodJS](https://www.inngest.com/docs/sdk/serve#framework-redwood), [AWS Lambda](https://www.inngest.com/docs/sdk/serve#framework-aws-lambda), and [anything else](https://www.inngest.com/docs/sdk/serve#custom-frameworks)) 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](https://www.inngest.com/discord)!_
Getting started ยท
Features ยท
Contributing ยท
Documentation
## Getting started
Install Inngest:
```bash
npm install inngest # or yarn add inngest
```### Writing functions
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.### Serving your functions
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](https://www.inngest.com/docs/sdk/serve?ref=github-inngest-js-readme). 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]);
```### Sending events to trigger functions
```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: "[email protected]", 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.
## Features
- **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](https://www.inngest.com/docs/sdk/serve?ref=github-inngest-js-readme)
- **Deploy anywhere**: Keep [deploying to your existing platform](https://www.inngest.com/docs/deploy?ref=github-inngest-js-readme): 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
## Contributing
Check out [`CONTRIBUTING.md`](CONTRIBUTING.md) to get started.