const caldotcom = client.defineHttpEndpoint({
  //this should be unique inside your project
  id: "cal.com",
  //usually you'd use the domain name of the service
  source: "cal.com",
  //the icon is optional, it displays in the dashboard
  icon: "caldotcom",
  //this function is called when a webhook is received
  verify: async (request) => {
    //this is a useful helper function that can verify sha256 signatures
    //each API has a different header name
    return await verifyRequestSignature({
      request,
      //you can find the header name in the API's documentation
      headerName: "X-Cal-Signature-256",
      //you can find the secret in the Trigger.dev dashboard, on the HTTP endpoint page
      secret: process.env.CALDOTCOM_SECRET!,
      algorithm: "sha256",
    });
  },
});

These are the docs for Trigger.dev v2 which will be deprecated on January 31st, 2025. You probably want the v3 docs.

An HTTP endpoint allows you to create an HTTP Trigger, which means you can trigger your Jobs from any webhooks.

const caldotcom = client.defineHttpEndpoint({
  //this should be unique inside your project
  id: "cal.com",
  //usually you'd use the domain name of the service
  source: "cal.com",
  //the icon is optional, it displays in the dashboard
  icon: "caldotcom",
  //this function is called when a webhook is received
  verify: async (request) => {
    //this is a useful helper function that can verify sha256 signatures
    //each API has a different header name
    return await verifyRequestSignature({
      request,
      //you can find the header name in the API's documentation
      headerName: "X-Cal-Signature-256",
      //you can find the secret in the Trigger.dev dashboard, on the HTTP endpoint page
      secret: process.env.CALDOTCOM_SECRET!,
      algorithm: "sha256",
    });
  },
});

Parameters

options
HTTPEndpointOptions
required

The options for the HTTP endpoint.

Returns

HttpEndpoint
HttpEndpoint

The HTTP Endpoint that was created. You should assign this to a variable, as you’ll need it to create an HTTP Trigger.