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

  1. Install @affitor/sdk and wrap your app in AffitorProvider with your program ID, as in the Next.js guide.
  2. Pass the click ID in the user’s metadata when you call supabase.auth.signUp.
  3. In an Edge Function, call trackLead with the Supabase user ID and that click ID. Use the same ID at sale time.

Read the full guide: Next.js + Supabase Auth guide

More integrations