Clerk
Point Clerk's user webhooks at Referalli: sign-ups are attributed, profile changes and bans follow, deletions erase.
Point Clerk's user webhooks at Referalli: sign-ups are attributed, profile changes and bans follow, deletions erase.
Connect
In the Clerk dashboard open Configure → Webhooks → Add Endpoint and paste your connection's webhook URL (
https://referalli.com/webhooks/auth/{id}).Subscribe to
user.created,user.updatedanduser.deleted.Copy the endpoint's Signing Secret (
whsec_…) and create the connection with it:{"provider": "clerk", "programId": "prg_…", "secret": "whsec_…"}. If you created the connection first, set it later withPUT /v1/auth/connections/{id}/secret.
Clerk signs with Svix (svix-id, svix-timestamp, svix-signature); deliveries more than 5 minutes old are refused.
Where the referral goes
await signUp.create({ emailAddress, password, unsafeMetadata: { ...window.aff.signupMetadata() } });Event | What Referalli does |
|---|---|
| Attributes the sign-up ( |
| Email and name follow to their partner record; |
| Erases the customer and their partner record. |
Referral context
On your sign-up page, with the tracking script loaded, window.aff.getReferral() returns the visitor's referral. Put it where this provider carries it (below), under the default keys referalli_anon_id, referalli_click_id and referalli_coupon. The older referally_* spellings are still read. Referalli never links users by email: without these keys a sign-up is not attributed.
For Clerk the referral is read from: data.unsafe_metadata.*.
Check it
Each webhook delivery is answered with what Referalli did per user (attributed, partnerId, matchedVia, or the reason it wasn't); signed-protocol calls take "test": true on /signups to see the answer without storing anything. Every connector is held to the same conformance suite.