diff --git a/docs/documentation/concepts/http-endpoints.mdx b/docs/documentation/concepts/http-endpoints.mdx index 2bade7cec..4d3f12a26 100644 --- a/docs/documentation/concepts/http-endpoints.mdx +++ b/docs/documentation/concepts/http-endpoints.mdx @@ -7,7 +7,7 @@ Sometimes you want to subscribe to changes from an API, and we don't have [an In ## Defining an HTTP endpoint -Defining an HTTP endpoint creates a URL and secret which you'll enter into Cal.com's website. It also attaches a `verify` function that is called when a webhook is received. It's compulsory to return a result from this function – 90% of the time you can use our `verifyRequestSignature` helper function. +We'll use Cal.com as an example: ```ts const caldotcom = client.defineHttpEndpoint({ @@ -33,6 +33,10 @@ const caldotcom = client.defineHttpEndpoint({ }); ``` +When this code runs (and you're running the CLI dev command) the HTTP endpoint will be created and be visible in the Trigger.dev dashboard. + +The `verify` function is compulsory and is automatically called when a webhook is received. It's required to return a result from this function – 90% of the time you can use our `verifyRequestSignature` helper function. + ## Getting the URL and secret In our dashboard, you can navigate to the HTTP endpoints page. From there you can select your endpoint and copy the URL (1) and secret (2) for the appropriate Environment.