inngest-cli
Advanced tools
Comparing version 0.10.0 to 0.11.0
{ | ||
"name": "inngest-cli", | ||
"version": "0.10.0", | ||
"version": "0.11.0", | ||
"description": "The event-driven queue for any language.", | ||
@@ -5,0 +5,0 @@ "license": "SEE LICENSE IN LICENSE.md", |
@@ -8,8 +8,6 @@ # Inngest | ||
Run reliable serverless functions in the background. Inngest allows you to schedule, enqueue, and run serverless functions in the background reliably with retries on any platform, with zero infrastructure, fully locally testable. Learn more: https://www.inngest.com. | ||
Run reliable serverless functions in the background. Inngest allows you to schedule, enqueue, and run serverless functions in the background reliably with retries on any platform, with zero infrastructure, fully locally testable. Learn more: https://www.inngest.com. | ||
<br /> | ||
- [Overview](#overview) | ||
@@ -30,5 +28,5 @@ - [Quick Start](#quick-start) | ||
Inngest makes it simple for you to write delayed or background jobs by triggering functions from events — decoupling your code from your application. | ||
Inngest makes it simple for you to write delayed or background jobs by triggering functions from events — decoupling your code within your application. | ||
- You send events from your application via HTTP (or via third party webhooks, e.g. Stripe) | ||
- You send events from your application via our SDK (or with a Webhook) | ||
- Inngest runs your serverless functions that are configured to be triggered by those events, either immediately, or delayed. | ||
@@ -51,27 +49,41 @@ | ||
👉 [Read the full quick start guide here](https://www.inngest.com/docs/quick-start?ref=github-inngest-readme) | ||
1. [NPM install our SDK for your typescript project](https://github.com/inngest/inngest-js): `npm install inngest` | ||
2. Run the Inngest dev server: `npx inngest@latest dev`. That's _this_ cli. | ||
3. [Integrate Inngest with your framework in one line](https://www.inngest.com/docs/frameworks/nextjs) via the `serve() handler` | ||
4. [Write and run functions in your existing framework or project](https://www.inngest.com/docs/functions) | ||
2. Run the Inngest dev server: `npx inngest@latest dev` (This repo's CLI) | ||
3. [Integrate Inngest with your framework in one line](https://www.inngest.com/docs/sdk/serve?ref=github-inngest-readme) via the `serve()` handler | ||
4. [Write and run functions in your existing framework or project](https://www.inngest.com/docs/functions?ref=github-inngest-readme) | ||
Here's an example: | ||
```js | ||
import { createStepFunction } from "inngest"; | ||
```ts | ||
import { Inngest } from "inngest"; | ||
// This function runs on any platform in the background with retries any time | ||
// the app/user.signup event is received - automatically. | ||
export const signupFlow = createStepFunction("post-signup", "app/user.signup", | ||
function ({ event, tools }) { | ||
// Send the user an email | ||
tools.run("Send an email", async () => { | ||
const inngest = new Inngest({ name: "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( | ||
{ name: "User onboarding communication" }, | ||
{ event: "app/user.signup" }, | ||
async ({ event, step }) => { | ||
await step.run("Send welcome email", async () => { | ||
await sendEmail({ | ||
email: event.user.email, | ||
email: event.data.email, | ||
template: "welcome", | ||
}) | ||
}) | ||
}) | ||
}); | ||
}); | ||
} | ||
); | ||
// Elsewhere in your code (e.g. in your sign up handler): | ||
inngest.send({ | ||
name: "app/user.signup", | ||
data: { | ||
email: "test@example.com", | ||
}, | ||
}); | ||
``` | ||
That's it - your function is set up! | ||
@@ -114,3 +126,3 @@ | ||
- [Post a question or idea to our Github discussion board](https://github.com/orgs/inngest/discussions) | ||
- [Read the documentation](https://www.inngest.com/docs) | ||
- [Read the documentation](https://www.inngest.com/docs?ref=github-inngest-readme) | ||
- [Explore our public roadmap](https://github.com/orgs/inngest/projects/1/) | ||
@@ -117,0 +129,0 @@ - [Follow us on Twitter](https://twitter.com/inngest) |
12434
131