Function handleWebhookRequestJob

  • Used to call Webhook Trigger event handler.

    Type Parameters

    • RequestPayload extends unknown

    Parameters

    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);