Skip to content

Commit 81ec8ab

Browse files
committedMar 25, 2025
feat(cloud-functions): add realtime and callable functions token typing
1 parent cce55b5 commit 81ec8ab

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed
 

‎src/v1/cloud-functions.ts

+21-1
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ export interface EventContext<Params = Record<string, string>> {
104104
* does not exist.
105105
*/
106106
auth?: {
107-
token: object;
108107
uid: string;
108+
token: EventContextAuthToken;
109109
};
110110

111111
/**
@@ -207,6 +207,26 @@ export interface EventContext<Params = Record<string, string>> {
207207
timestamp: string;
208208
}
209209

210+
export interface EventContextAuthToken {
211+
iss: string;
212+
aud: string;
213+
auth_time: number;
214+
iat: number;
215+
exp: number;
216+
sub: string;
217+
email?: string;
218+
email_verified?: boolean;
219+
phone_number?: string;
220+
name?: string;
221+
firebase?: {
222+
identities?: {
223+
[key: string]: string[];
224+
};
225+
sign_in_provider?: string;
226+
tenant?: string;
227+
};
228+
}
229+
210230
/**
211231
* Resource is a standard format for defining a resource
212232
* (google.rpc.context.AttributeContext.Resource). In Cloud Functions, it is the

0 commit comments

Comments
 (0)