---
title: Next.js + Supabase integration
description: "Tracks signups from Supabase Auth in a Next.js app, sent from an Edge Function."
type: integration
url: "https://affitor.com/integrations/nextjs-supabase"
index: "https://affitor.com/llms.txt"
---

# 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](https://affitor.com/docs/api-reference/integrations/nextjs#supabase)

- Category: Frameworks and auth
- Works with: Next.js, Supabase Auth, Edge Functions
- Package: @affitor/sdk, in beta
- Docs: [Next.js + Supabase Auth guide](https://affitor.com/docs/api-reference/integrations/nextjs#supabase)

## More integrations

- [Next.js](https://affitor.com/integrations/nextjs): Track signups in a Next.js app
- [Next.js + Clerk](https://affitor.com/integrations/nextjs-clerk): Signups from Clerk
- [Next.js + NextAuth](https://affitor.com/integrations/nextjs-nextauth): Signups from Auth.js
