> ## Documentation Index
> Fetch the complete documentation index at: https://trigger.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Firecrawl webhooks

> Receive and verify Firecrawl webhooks with Trigger.dev. Check the HMAC-SHA256 signature in x-firecrawl-signature and run a task for each Firecrawl event, filtered on event.type.

**`webhooks.firecrawl()` verifies the HMAC-SHA256 signature Firecrawl sends in `x-firecrawl-signature` on every request.**

```ts /trigger/firecrawl.ts theme={"theme":"css-variables"}
import { webhook, webhooks } from "@trigger.dev/sdk";

export const firecrawl = webhooks.endpoint.define({
  id: "firecrawl",
  source: webhooks.firecrawl(),
});

export const firecrawlEvents = webhook({
  id: "firecrawl-events",
  endpoint: firecrawl,
  filter: "event.type == 'crawl.completed'",
  onEvent: async ({ event }) => {
    console.log(event);
  },
});
```

| Setting | Value |
| - | - |
| Source | `webhooks.firecrawl()` |
| Verification | HMAC-SHA256 in `x-firecrawl-signature` |
| Credential | Signing secret issued by Firecrawl |
| Event type | `event.type` |
| Firecrawl docs | [Firecrawl webhook docs](https://docs.firecrawl.dev/webhooks/overview) |

## Set up Firecrawl

1. Start `trigger dev` or deploy, then copy the endpoint's **Webhook URL** from the **Webhooks** page.
2. Copy the webhook secret from the **Advanced** tab of your Firecrawl account settings. It is one secret for the whole account.
3. Choose **Set signing secret** on the Trigger.dev endpoint and paste it.
4. Firecrawl has no webhook settings page. Pass a `webhook` object with the URL and events on each crawl, batch scrape, extract or agent request instead:

   ```ts Your crawl code theme={"theme":"css-variables"}
   await firecrawl.crawl("https://example.com", {
     webhook: {
       url: "<webhook URL>",
       events: ["started", "page", "completed"],
     },
   });
   ```
5. Start a crawl with the `webhook` object, or use the endpoint's **Test** tab, and check the endpoint's **Deliveries** tab. See [Verify the connection](https://trigger.dev/docs/webhooks/connect.md#verify-the-connection) if nothing arrives.

## Example task

The [Firecrawl URL crawl example](https://trigger.dev/docs/guides/examples/firecrawl-url-crawl.md) crawls a site from a task. Add the `webhook` object above to receive each page as a delivery.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.