Next.js + Supabase
Tracks signups from Supabase Auth in a Next.js app, sent from an Edge Function.
What it does
- An Edge Function sends the lead from your server, which settles it.
- The click reaches the function through the user’s metadata, since it has no browser cookie.
- Clicks and sales work as in the Next.js guide.
Set up in three steps
- Install
@affitor/sdkand wrap your app inAffitorProviderwith your program ID, as in the Next.js guide. - Pass the click ID in the user’s metadata when you call
supabase.auth.signUp. - In an Edge Function, call
trackLeadwith the Supabase user ID and that click ID. Use the same ID at sale time.