Skip to content

Commit b1c952b

Browse files
fix(ai): allow auth and app check to be passed in
1 parent 11cf91b commit b1c952b

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

packages/ai/lib/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ export function getAI(
6666
app,
6767
backend: options.backend,
6868
location: (options.backend as VertexAIBackend)?.location || '',
69+
appCheck: options.appCheck || null,
70+
auth: options.auth || null,
6971
} as AI;
7072
}
7173

packages/ai/lib/models/ai-model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export abstract class AIModel {
6666
location: ai.location,
6767
backend: ai.backend,
6868
};
69+
6970
if ((ai as AIService).appCheck) {
7071
this._apiSettings.getAppCheckToken = () => (ai as AIService).appCheck!.getToken();
7172
}

packages/ai/lib/public-types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ export interface AIOptions {
3333
* The backend configuration to use for the AI service instance.
3434
*/
3535
backend: Backend;
36+
appCheck?: FirebaseAppCheckTypes.Module | null;
37+
auth?: FirebaseAuthTypes.Module | null;
3638
}
3739

3840
/**

0 commit comments

Comments
 (0)