inngest
Version:
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.
66 lines • 1.84 kB
TypeScript
/**
* An adapter for H3 to serve and register any declared functions with Inngest,
* making them available to be triggered by events.
*
* @example
* ```ts
* import { createApp, eventHandler, toNodeListener } from "h3";
* import { serve } from "inngest/h3";
* import { createServer } from "node:http";
* import { inngest } from "./inngest/client";
* import fnA from "./inngest/fnA";
*
* const app = createApp();
* app.use(
* "/api/inngest",
* eventHandler(
* serve({
* client: inngest,
* functions: [fnA],
* })
* )
* );
*
* createServer(toNodeListener(app)).listen(process.env.PORT || 3000);
* ```
*
* @module
*/
import { type EventHandlerRequest, type H3Event } from "h3";
import { type ServeHandlerOptions } from "./components/InngestCommHandler.js";
import { type SupportedFrameworkName } from "./types.js";
/**
* The name of the framework, used to identify the framework in Inngest
* dashboards and during testing.
*/
export declare const frameworkName: SupportedFrameworkName;
/**
* In h3, serve and register any declared functions with Inngest, making
* them available to be triggered by events.
*
* @example
* ```ts
* import { createApp, eventHandler, toNodeListener } from "h3";
* import { serve } from "inngest/h3";
* import { createServer } from "node:http";
* import { inngest } from "./inngest/client";
* import fnA from "./inngest/fnA";
*
* const app = createApp();
* app.use(
* "/api/inngest",
* eventHandler(
* serve({
* client: inngest,
* functions: [fnA],
* })
* )
* );
*
* createServer(toNodeListener(app)).listen(process.env.PORT || 3000);
* ```
*
* @public
*/
export declare const serve: (options: ServeHandlerOptions) => ((event: H3Event<EventHandlerRequest>) => Promise<void>);
//# sourceMappingURL=h3.d.ts.map