Function handleWebhookRequestJob
- handle
Webhook <RequestPayload>(opts): Promise<void>Request Job Type Parameters
RequestPayload extends unknown
Parameters
opts: HandleWebhookRequestJobOpts<RequestPayload>
Returns Promise<void>
See
Example
import {
defineHTTPHandler,
handleWebhookRequestJob,
} from "@rollout/framework";
import { Hono } from "hono";
import { trigger } from "./triggers/my-webhook-trigger";
export const router = new Hono().post("/webhooks/:webhookId", async (c) => {
const body = await c.req.json();
const webhookId = c.req.param("webhookId");
handleWebhookRequestJob({
triggerDef: trigger,
requestPayload: {
webhookId,
body,
},
});
});
export const http = defineHTTPHandler(router.fetch);
Used to call Webhook Trigger event handler.