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

# Whop

> Receive Whop purchases and subscriptions in Datalyr.

The Whop source uses a workspace-specific webhook to send purchases and subscriptions to Datalyr.

## Connect Whop

1. Open **Sources**, choose **Whop**, and select **Connect**.
2. Copy the webhook URL displayed by Datalyr.
3. In Whop, open **Developer → Webhooks** and create the endpoint.
4. Paste the Whop webhook secret into Datalyr when you want signature verification.
5. Save the connection and send a test event from Whop.

The webhook secret is optional in the connection UI, but signature verification is strongly recommended for production.

## Link a checkout to the visitor

The Web SDK exposes Whop checkout metadata:

```ts theme={null}
const metadata = datalyr.getWhopCheckoutMetadata()
// { visitor_id: '...' }
```

Attach this metadata when your Whop checkout flow supports it. It gives Datalyr a deterministic link to the earlier web visit.

## Verify

Confirm a test purchase or subscription appears in **Events**, then open the customer in **Users** and check that the earlier landing visit is present.
