Made it clearer in the HTTP endpoints docs that we’re using Cal.com as an example

This commit is contained in:
Matt Aitken
2023-11-08 10:15:42 +00:00
parent 55a9b96c88
commit e48c9b5e69
@@ -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.