1. SDK Reference
  2. webhookEvent Trigger

Usage

import { webhookEvent, Trigger } from "@trigger.dev/sdk";

new Trigger({
  id: "caldotcom-to-slack",
  name: "Cal.com To Slack",
  on: webhookEvent({
    service: "cal.com",
    eventName: "BOOKING_CREATED",
    filter: {
      triggerEvent: ["BOOKING_CREATED"],
    },
    schema: z.any(),
    verifyPayload: {
      enabled: true,
      header: "X-Cal-Signature-256",
    },
  }),
  run: async (event, ctx) => {},
}).listen();

Options

serviceRequired
string

The name of the service that will be sending the webhook event.

nameRequired
string

The name of the event that will be sent by the service.

filter
object

An event filter to apply to the webhook event. See the event filter documentation for more information.

schemaRequired
Zod Schema

A Zod schema to validate the webhook event payload against. See our Zod guide for more information.

verifyPayload
object

Verify the payload of the webhook event. Currently only supports sha256 HMAC signatures.