Webhooks

Receive real-time notifications for task events.

Setup

  1. Register webhook at https://cloud.browser-use.com/webhooks
  2. Verify signatures

Verification

Always verify webhook signatures.

1import { verifyWebhookEventSignature, type WebhookAgentTaskStatusUpdatePayload } from "browser-use-sdk";
2
3export async function POST(req: Request) {
4 const signature = req.headers["x-browser-use-signature"] as string;
5 const timestamp = req.headers["x-browser-use-timestamp"] as string;
6
7 const event = await verifyWebhookEventSignature(
8 {
9 body,
10 signature,
11 timestamp,
12 },
13 {
14 secret: SECRET_KEY,
15 },
16 );
17
18 if (!event.ok) {
19 return;
20 }
21
22 switch (event.event.type) {
23 case "agent.task.status_update":
24 break;
25 case "test":
26 break;
27 default:
28 break;
29 }
30}

Verify signatures to ensure events come from Browser Use.