The Supabase documentation example for assigning role custom claims with Firebase Admin SDK incorrectly references `userRecord.id`, which does not exist on Firebase UserRecord objects. The correct property is `userRecord.uid`. Following the example as written causes a runtime error when calling `setCustomUserClaims` with `undefined` as the user identifier.
Origin Analysis
The documentation snippet uses `userRecord.id`, but the Firebase Admin Node.js SDK's UserRecord interface defines `uid` as the unique user identifier property. This is a typo/misreference in the Supabase documentation.
1. Open the Supabase docs page: https://supabase.com/docs/guides/auth/third-party/firebase-auth#use-the-admin-sdk-to-assign-the-role-custom-claim-to-all-users
2. Copy the provided Firebase Admin code snippet.
3. Run the script with a valid Firebase service account.
4. Observe that `userRecord.id` is `undefined`, causing `setCustomUserClaims(undefined, { role: 'supabase_access' })` to throw an error like `TypeError: uid must be a non-empty string`.