@@ -33,21 +33,12 @@ public final class FirebaseAI: Sendable {
3333 /// - backend: The backend API for the Firebase AI SDK; if not specified, uses the default
3434 /// ``Backend/googleAI()`` (Gemini Developer API).
3535 /// - useLimitedUseAppCheckTokens: When sending tokens to the backend, this option enables
36- /// the usage of App Check's limited-use tokens instead of the standard cached tokens.
37- ///
38- /// A new limited-use tokens will be generated for each request; providing a smaller attack
39- /// surface for malicious parties to hijack tokens. When used alongside replay protection,
40- /// limited-use tokens are also _consumed_ after each request, ensuring they can't be used
41- /// again.
36+ /// the usage of App Check's limited-use tokens instead of the standard cached tokens. Learn
37+ /// more about [limited-use tokens](https://firebase.google.com/docs/ai-logic/app-check),
38+ /// including their nuances, when to use them, and best practices for integrating them into
39+ /// your app.
4240 ///
4341 /// _This flag is set to `false` by default._
44- ///
45- /// > Important: Replay protection is not currently supported for the FirebaseAI backend.
46- /// > While this feature is being developed, you can still migrate to using
47- /// > limited-use tokens. Because limited-use tokens are backwards compatible, you can still
48- /// > use them without replay protection. Due to their shorter TTL over standard App Check
49- /// > tokens, they still provide a security benefit.
50- /// >
5142 /// > Migrating to limited-use tokens sooner minimizes disruption when support for replay
5243 /// > protection is added.
5344 /// - Returns: A `FirebaseAI` instance, configured with the custom `FirebaseApp`.
@@ -110,8 +101,7 @@ public final class FirebaseAI: Sendable {
110101 tools: tools,
111102 toolConfig: toolConfig,
112103 systemInstruction: systemInstruction,
113- requestOptions: requestOptions,
114- useLimitedUseAppCheckTokens: useLimitedUseAppCheckTokens
104+ requestOptions: requestOptions
115105 )
116106 }
117107
@@ -147,8 +137,7 @@ public final class FirebaseAI: Sendable {
147137 apiConfig: apiConfig,
148138 generationConfig: generationConfig,
149139 safetySettings: safetySettings,
150- requestOptions: requestOptions,
151- useLimitedUseAppCheckTokens: useLimitedUseAppCheckTokens
140+ requestOptions: requestOptions
152141 )
153142 }
154143
@@ -163,8 +152,6 @@ public final class FirebaseAI: Sendable {
163152
164153 let apiConfig : APIConfig
165154
166- let useLimitedUseAppCheckTokens : Bool
167-
168155 /// A map of active `FirebaseAI` instances keyed by the `FirebaseApp` name and the `location`,
169156 /// in the format `appName:location`.
170157 private nonisolated ( unsafe) static var instances : [ InstanceKey : FirebaseAI ] = [ : ]
@@ -227,11 +214,11 @@ public final class FirebaseAI: Sendable {
227214 projectID: projectID,
228215 apiKey: apiKey,
229216 firebaseAppID: app. options. googleAppID,
230- firebaseApp: app
217+ firebaseApp: app,
218+ useLimitedUseAppCheckTokens: useLimitedUseAppCheckTokens
231219 )
232220 self . apiConfig = apiConfig
233221 self . location = location
234- self . useLimitedUseAppCheckTokens = useLimitedUseAppCheckTokens
235222 }
236223
237224 func modelResourceName( modelName: String ) -> String {
0 commit comments