You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[firebase_ai] Live sessions on web don't send the App Check token #18938
On web, a LiveGenerativeModel session doesn't send the App Check token, so when App Check is enforced for Firebase AI Logic the server closes every Live session right after it connects:
live_model.dart builds those headers with BaseModel.firebaseTokens(...), so the X-Firebase-AppCheck header (and the Auth token) only reach the server on native platforms. On web the token is in neither the URL (only ?key=) nor the setup message. Browsers can't set headers on a WebSocket, so the token needs to travel another way, for example as a query parameter or in the setup message, if the backend accepts one.
Same code in firebase_ai 3.15.0, 4.0.0, 5.0.0 and 5.1.0.
Repro
Enforce App Check for Firebase AI Logic and register a web debug token.
On Chrome, connect a Live session, for example FirebaseAI.googleAI().liveGenerativeModel(model: 'gemini-3.8-live') and connect().
The server closes the socket with 1008 "Firebase App Check token is invalid".
Seen with the Gemini Developer API and with Agent Platform (us-central1). Found through the Genkit Firebase AI plugin: genkit-ai/genkit-dart#730.
This is valid. The browser WebSocket API cannot set those headers, and the Live backend does not currently accept the App Check token on the URL or in the setup message either. Firebase is tracking the same limitation in the JavaScript SDK and has said a backend change is required before a browser client can send the token: firebase/firebase-js-sdk#10018.
That change is not available yet, so there is no FlutterFire-only fix for web. I'll keep this opened so we can keep track of this.
Activity
SelaseKay commentedon Nov 11, 2026
Hi @adesinah, thanks for the report. I'm looking into this.
SelaseKay commentedon Nov 11, 2026
Hi @adesinah, thanks again for the report.
This is valid. The browser WebSocket API cannot set those headers, and the Live backend does not currently accept the App Check token on the URL or in the setup message either. Firebase is tracking the same limitation in the JavaScript SDK and has said a backend change is required before a browser client can send the token: firebase/firebase-js-sdk#10018.
That change is not available yet, so there is no FlutterFire-only fix for web. I'll keep this opened so we can keep track of this.