What Firebase supplies
One value:uid. Firebase is the provider that does not arrive as a cookie your
server can read — the browser holds an ID token and sends it, and a token is
a string anybody can compose. verifyIdToken is what turns it into a fact.
lib/firebase.ts
The server half
app/api/userkit-boot/route.ts
401, exactly as an absent one does.
The difference is a detail about your verification that the browser has no use
for.
The client half
getState().verified is true only when the HMAC checked out. Signed in to
Firebase with verified: false means either the secret belongs to the other
environment or the message signed was not exactly the external_id.
Session cookies work too
createSessionCookie is the other shape, and it makes this endpoint look like
the Supabase one: read the cookie, verify it with verifySessionCookie, sign
the uid. Nothing above the provider line changes.
Configuration
What does not travel
A Firebase ID token carries anemail and an email_verified claim. They are
statements about Firebase’s records, and they do not become identities in
UserKit: an email sent through /v1/boot is stored as an attribute, does not
resolve to an existing contact and does not become an identity edge. The HMAC
proves the external_id and only the external_id.
To prove an address, send a magic link or an email
code — the two flows that arrive in it.
The full example
A runnable Next app with these files, an
.env.example and the pieces this page
leaves out.