UNPKG

@novu/framework

Version:

The Code-First Notifications Workflow SDK.

34 lines (31 loc) 1.3 kB
import { S as ServeHandlerOptions } from '../index-CmEcpAEO.js'; export { C as Client, N as NovuRequestHandler, w as workflow } from '../index-CmEcpAEO.js'; export { C as CronExpression, S as SeverityLevelEnum, W as Workflow, p as providerSchemas } from '../health-check.types-D_KcRiM_.js'; import { S as SupportedFrameworkName } from '../server.types-BRWsA1CA.js'; 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 };