LinkTrace docs

Supabase: track signup or login after your server resolves the user

Use server-side Supabase auth flows for the cleanest attribution path. Once the user exists or the session is valid, send the lead event to LinkTrace.

Signup tracking

Call the helper after your backend creates the user successfully.

ts
import { trackSupabaseSignup, fromExpressRequest } from "@finndean/linktrace-node"

await trackSupabaseSignup(
  linktrace,
  fromExpressRequest(req),
  supabaseUser,
  { eventName: "signup" },
)

Login tracking

The login path is the same model. Track it after your application confirms sign-in succeeded.

ts
import { trackSupabaseLogin, fromExpressRequest } from "@finndean/linktrace-node"

await trackSupabaseLogin(
  linktrace,
  fromExpressRequest(req),
  supabaseUser,
  { eventName: "login" },
)
Related guides