@novu/framework
Version:
The Code-First Notifications Workflow SDK.
34 lines (31 loc) • 1.31 kB
text/typescript
import { S as ServeHandlerOptions } from '../index-S0QKfWxm.cjs';
export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-S0QKfWxm.cjs';
export { C as CronExpression, S as SeverityLevelEnum, W as Workflow, p as providerSchemas } from '../health-check.types-D_KcRiM_.cjs';
import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.cjs';
import 'json-schema-to-ts';
import 'zod';
declare const frameworkName: SupportedFrameworkName;
/**
* Serve and register any declared workflows with Novu, making them available
* to be triggered by events.
*
* The return type is currently `any` to ensure there's no required type matches
* between the `express` and `vercel` packages. This may change in the future to
* appropriately infer.
*
* @example
* ```ts
* import { serve } from "@novu/framework/express";
* import { myWorkflow } from "./src/novu/workflows"; // Your workflows
*
* // Important: ensure you add JSON middleware to process incoming JSON POST payloads.
* app.use(express.json());
* app.use(
* // Expose the middleware on our recommended path at `/api/novu`.
* "/api/novu",
* serve({ workflows: [myWorkflow] })
* );
* ```
*/
declare const serve: (options: ServeHandlerOptions) => any;
export { ServeHandlerOptions, frameworkName, serve };