Firebase field definitions
Firebase identity has three distinct credentials. A custom token starts the configured provider client flow. An ID token identifies that provider user. A Wallkit session token identifies a Wallkit session. Send ID tokens in firebase-token where specified and Wallkit tokens in token; neither header accepts a custom token as a substitute. The registration operation instead reads firebase_id_token from its JSON body.
Firestore fields
firestore is a dynamic, nonempty named field map. Its keys identify provider document fields/paths, not an API-defined profile schema. The operation uses collection users and document ID equal to the resource relationship’s Firebase UID.
| Input form | Meaning and conditions |
|---|---|
| Plain JSON value | Passed to the configured provider writer. No local closed field/type schema or provider acceptance guarantee. |
{ "type": "date", "value": "2030-01-01T00:00:00Z" } | When both members are non-null, value is parsed as a date and converted to a provider Timestamp. Include an explicit timezone; no default timezone guarantee. |
{ "type": "string", "value": "techno" } | Any structured type other than date unwraps value unchanged; string is illustrative, not a validated enum. |
| Object missing/null type or value | Does not enter the structured conversion branch; passed as the original value. |
Existing documents update only supplied paths; missing documents are created using submitted fields. This is not a full-document replacement. No field deletion syntax is established here. The helper falls back to email for an empty/countless map, but the operation’s presence validation requires a nonempty firestore value; use a named object rather than depending on fallback behavior.
The local user.extra.firestore stores the submitted representation plus id set to the Firebase UID. Structured date/type wrappers remain local JSON objects. With existing extra data, supplied Firestore child keys merge while untouched keys remain; an empty extra map is initialized. Other extra properties are preserved. Do not treat the local map as a fetched snapshot of the provider document. Provider write precedes the local save, and save success is not independently reported.
Subscription history
The Firestore update’s nested user adds subscriptions_history to the resource-aware user, which already defines subscriptions and teams. It does not add last_action.
subscriptions_history is an array of stored plan history rows for this user/resource, empty with no rows. No paginator or explicit ordering. Each row has:
| Field | Type / presence | Meaning |
|---|---|---|
subscription_start_date, subscription_end_date | stored timestamp / nullable | Historical relationship interval; no timezone or exclusive-end guarantee. |
created_at | stored timestamp | Creation of the history row, not necessarily the beginning of access. |
is_team_subscription, is_trial | stored flags | Historical team/trial state; serializer does not explicitly cast them. |
new_subscription | stored field / nullable | Recorded replacement subscription value; no complete value set or current membership guarantee. |
team_id | stored integer ID / nullable | Related team when recorded. |
plan_id, subscription_id | stored integer IDs / nullable | Historical plan and Pricing references; no nested Pricing projection here. |
History is not evidence of a current active membership, refund or provider cancellation. For serving content, make the access decision.