Verifies the webhook signature from the webhook-id, webhook-timestamp and webhook-signature
headers using your webhook signing key, then parses the payload into an event. Fails if the
signature is missing or invalid.
Parameters
Returns
Unwrap
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
apiKey: process.env["ANTHROPIC_API_KEY"] // This is the default and can be omitted
});
// `body` is the raw body of the incoming webhook request and `headers` are its HTTP headers.
const event = client.beta.webhooks.unwrap(body, { headers });
console.log(event);