← FirebaseCONTENT HISTORY

Update to Firebase

Snapshot Nov 3, 2026 · 00:11 UTC · version 1.2.0

Collection source: downloaded plugin package. These snapshots do not have a confirmed matching collection source. Differences in file lists alone do not establish changes to the package.

WHAT CHANGED

Payment or plan references changed

Full description — Now says: Integrates Firebase AI Logic (formerly Vertex AI for Firebase) into mobile and web apps (Android, iOS, Web, and Flutter) to call Gemini models from client...

Observed in published text. Live prices and checkout terms have not been verified by this change.

Save Firebase and check future changes in Following.

Up to 10 plugins free · no card required.

All fields and original values.

Full description

Before

Sep 30, 2026 · 23:02 UTC

Official skill for integrating Firebase AI Logic (Gemini API) into web applications. Covers setup, multimodal inference, structured output, and security.

After

Nov 3, 2026 · 00:11 UTC

Integrates Firebase AI Logic (formerly Vertex AI for Firebase) into mobile and web apps (Android, iOS, Web, and Flutter) to call Gemini models from client code. Use when provisioning or initializing Firebase AI Logic, or adding Gemini fe...

Skill instructions

Before

Sep 30, 2026 · 23:02 UTC

Official skill for integrating Firebase AI Logic (Gemini API) into web applications. Covers setup, multimodal inference, structured output, and security. to their mobile and web apps using client-side SDKs. You can call Gemini models dir...

After

Nov 3, 2026 · 00:11 UTC

>- Integrates Firebase AI Logic (formerly Vertex AI for Firebase) into mobile and web apps (Android, iOS, Web, and Flutter) to call Gemini models from client code. Use when provisioning or initializing Firebase AI Logic, or adding Gemi...

Supporting files

Before

Sep 30, 2026 · 23:02 UTC

[{"relative_path":"references/flutter_setup.md","size_in_bytes":3335},{"relative_path":"references/ios_setup.md","size_in_bytes":4834},{"relative_path":"references/usage_patterns_android.md","size_in_bytes":4545},{"relative_path":"refere...

After

Nov 3, 2026 · 00:11 UTC

[{"relative_path":"references/flutter_setup.md","size_in_bytes":5169},{"relative_path":"references/ios_setup.md","size_in_bytes":8275},{"relative_path":"references/tts_generation.md","size_in_bytes":22260},{"relative_path":"references/us...

Compare saved observations

Download comparison JSON

SKILL.md text changes

− removed · + added

--- before
+++ after
@@ -1,8 +1,10 @@
 ---
 name: firebase-ai-logic-basics
-description: Official skill for integrating Firebase AI Logic (Gemini API) into web applications. Covers setup, multimodal inference, structured output, and security.
+description: >-
+  Integrates Firebase AI Logic (formerly Vertex AI for Firebase) into mobile and web apps (Android, iOS, Web, and Flutter) to call Gemini models from client code. Use when provisioning or initializing Firebase AI Logic, or adding Gemini features to an app: text generation, multimodal input, chat, streaming, structured output, hybrid on-device inference, App Check protection, or switching models with Remote Config.
 version: 1.0.1
 metadata:
+  author: Google LLC
   category: AiAndMachineLearning
 ---
 
@@ -11,63 +13,108 @@
 ## Overview
 
 Firebase AI Logic is a product of Firebase that allows developers to add gen AI
-to their mobile and web apps using client-side SDKs. You can call Gemini models
-directly from your app without managing a dedicated backend. Firebase AI Logic,
-which was previously known as "Vertex AI for Firebase", represents the evolution
-of Google's AI integration platform for mobile and web developers.
+to their mobile and web apps using client-side SDKs. The app can directly call
+Gemini models via Firebase AI Logic without the developer needing to manage a
+dedicated backend. Firebase AI Logic was previously known as "Vertex AI for
+Firebase".
 
 It supports the two Gemini API providers:
 
--   **Gemini Developer API**: It has a free tier ideal for prototyping, and
-    pay-as-you-go for production
--   **Agent Platform Gemini API** (formerly branded Vertex AI): Ideal for scale
-    with enterprise-grade production readiness, requires Blaze plan
+- **Gemini Developer API**: It has a free tier ideal for prototyping, and
+  pay-as-you-go for production
+- **Agent Platform Gemini API** (formerly branded Vertex AI): Ideal for scale
+  with enterprise-grade production readiness, requires Blaze pricing plan
 
 Use the Gemini Developer API as a default, and only Agent Platform Gemini API
 (formerly branded Vertex AI) if the application requires it.
 
-## Setup & Initialization
+______________________________________________________________________
 
-### Prerequisites
-
--   Before starting, ensure you have **Node.js 16+** and npm installed. Install
-    them if they aren’t already available.
--   Identify the platform the user is interested in building on prior to
-    starting: Android, iOS, Flutter or Web.
--   If their platform is unsupported, Direct the user to Firebase Docs to learn
-    how to set up AI Logic for their application (share this link with the user
-    https://firebase.google.com/docs/ai-logic/get-started)
-
-### Installation
-
-The library is part of the standard Firebase Web SDK.
-
-`npm install -g firebase@latest`
-
-If you're in a firebase directory (with a firebase.json) the currently selected
-project will be marked with "current" using this command:
-
-`npx -y firebase-tools@latest projects:list`
-
-Ensure there's at least one app associated with the current project
+## Setup & initialization
 
-`npx -y firebase-tools@latest apps:list`
-
-Initialize AI logic SDK with the init command
+### Prerequisites
 
-`npx -y firebase-tools@latest init ailogic`
+- Identify the platform the user is interested in building on prior to starting:
+  Android, iOS, Web, or Flutter.
+- If their platform is unsupported, Direct the user to Firebase Docs to learn
+  how to set up AI Logic for their application (share this link with the user
+  https://firebase.google.com/docs/ai-logic/get-started)
+- The Firebase CLI commands below run through `npx` on every platform, so they
+  need **Node.js 20+** and npm. Use the `firebase-basics` skill to check for
+  them and to log in to the Firebase CLI. If Node.js is missing or older than
+  version 20, ask the user to install it as that skill describes. Don't install
+  system packages yourself, for example with `sudo apt-get`, because that
+  changes the user's machine without their consent.
+
+### 1. Provision Firebase AI Logic (ALL platforms)
+
+Use the **Firebase CLI** to provision Firebase AI Logic for the Firebase
+Project:
+
+1. Make sure that you're in a firebase directory (with a `firebase.json`).
+
+1. Verify that you're running Firebase CLI commands against the intended
+   Firebase Project. When you run this command, the active project is marked
+   with "current":
+
+   ```bash
+   npx -y firebase-tools@latest projects:list
+   ```
+
+1. Make sure there's at least one Firebase App for the target platform
+   registered with the current Firebase Project:
+
+   ```bash
+   npx -y firebase-tools@latest apps:list
+   ```
+
+1. Provision Firebase AI Logic for the Firebase Project:
+
+   ```bash
+   npx -y firebase-tools@latest init ailogic
+   ```
+
+   This command will enable the Gemini Developer API in the Firebase project.
+
+> [!WARNING] **CRITICAL: Provisioning Firebase AI Logic is Required** For all
+> platforms (Android, iOS, Web, or Flutter), even if the app already uses
+> Firebase, you MUST run `npx -y firebase-tools@latest init ailogic` to
+> provision the service. The configuration files of `GoogleService-Info.plist`,
+> `google-services.json`, and `firebase_options.dart` ONLY handle client
+> configuration and do NOT enable the Firebase AI Logic service, leading to
+> `PERMISSION_DENIED` errors.
 
-This will automatically enable the Gemini Developer API in the Firebase console.
+If you can't run `init ailogic` yourself (for example because Node.js is missing
+or the Firebase CLI isn't logged in) do NOT skip it. The app's requests to
+Gemini models will fail until the Firebase AI Logic service is provisioned. Tell
+the user to run this command in their project directory, and include it in your
+final summary:
+
+```bash
+npx -y firebase-tools@latest init ailogic
+```
+
+### 2. Add the SDK and initialize the service in the app
+
+Adding the SDK dependency and initializing the service are platform-specific.
+Before writing code, read the reference for the target platform listed under
+[Initialization Code References](#initialization-code-references).
 
 More info in
 [Firebase AI Logic Getting Started](https://firebase.google.com/docs/ai-logic/get-started.md.txt)
 
+______________________________________________________________________
+
 ## Core Capabilities
 
 > [!WARNING] **CRITICAL: Use current model names:** Always check the
 > [Firebase AI Logic Models documentation](https://firebase.google.com/docs/ai-logic/models.md.txt)
-> for the currently supported model names. Do NOT use `gemini-2.0-pro` or
-> `gemini-2.0-flash` or other older models that are shutdown.
+> for the currently supported model names. Do NOT use any Gemini 1.x or Gemini
+> 2.x models (such as `gemini-1.5-flash`, `gemini-1.5-pro`, `gemini-2.0-flash`,
+> `gemini-2.0-pro`, `gemini-2.5-flash`, `gemini-2.5-flash-lite`, or
+> `gemini-2.5-pro`), as older models are deprecated or shut down. Always use a
+> currently supported Gemini 3+ model; if URL access is blocked in your
+> environment, proceed directly without searching local files.
 
 ### Text-Only Generation
 
@@ -91,16 +138,42 @@
 typing effect), use `generateContentStream` instead of `generateContent` for
 faster display of results.
 
+### Text-to-Speech (TTS) Generation
+
+Generate spoken audio directly on client devices without a custom speech
+backend. Firebase AI Logic supports speech synthesis using dedicated Gemini TTS
+models:
+
+- **Supported Models**: `gemini-3.1-flash-tts-preview`
+- **Capabilities**:
+  - Single-speaker voice persona selection (`voiceName`) and multi-speaker
+    dialogues (up to 2 distinct speakers) via `SpeechConfig` /
+    `MultiSpeakerVoiceConfig`
+  - Direct audio responses by setting `responseModalities` to audio
+  - Streaming speech responses with `generateContentStream` for low-latency
+    playback
+  - Audio directives (`[Audio Profile: ...]`, `[Scene: ...]`,
+    `[Director's Note: ...]`) and emotional tags (`[whispers]`, `[laughs]`,
+    `[slowly]`)
+  - Client-side decoding and playback of 24 kHz 16-bit linear PCM (`audio/l16`)
+    or WAV container format (`audio/x-wav`)
+
+See the [Text-to-Speech (TTS) Generation Guide](references/tts_generation.md)
+for full implementation details, streaming patterns, and copy-paste code
+snippets for iOS (Swift), Android (Kotlin), and Web.
+
 ### Generate Images with Nano Banana
 
 > [!WARNING] **Use current Image model names:** Always check the
 > [Firebase AI Logic Models documentation](https://firebase.google.com/docs/ai-logic/models.md.txt)
 > for the currently supported image generation (Nano Banana) model names.
 
--   Requires an upgraded Blaze pay-as-you-go billing plan.
+- Requires an upgraded Blaze pay-as-you-go billing plan.
 
 ### Search Grounding with the built in googleSearch tool
 
+______________________________________________________________________
+
 ## Supported Platforms and Frameworks
 
 Supported Platforms and Frameworks include Kotlin and Java for Android, Swift
@@ -114,23 +187,26 @@
 
 ### On-Device AI (Hybrid)
 
-Hybrid on-device inference for web apps, where the Firebase Javascript SDK
-automatically checks for Gemini Nano's availability (after installation) and
-switches between on-device or cloud-hosted prompt execution. This requires
-specific steps to enable model usage in the Chrome browser, more info in the
-[hybrid-on-device-inference documentation](https://firebase.google.com/docs/ai-logic/hybrid-on-device-inference.md.txt).
+Hybrid inference runs prompts with an on-device model when one is available and
+falls back to a cloud-hosted model otherwise (or vice versa). Availability and
+setup steps differ by platform, more info in the
+[hybrid and on-device documentation](https://firebase.google.com/docs/ai-logic/hybrid.md.txt),
+which links to each platform's guide.
+
+______________________________________________________________________
 
 ## Security & Production
 
-### App Check
+### Firebase App Check
 
 > [!WARNING] **Critical Safety Requirement:** In order to use AI Logic safely,
 > you MUST set up App Check on your app. This prevents unauthorized clients from
 > using your API quota and accessing your backend resources.
 
 See
-[App Check with reCAPTCHA Enterprise](https://firebase.google.com/docs/app-check/web/recaptcha-enterprise-provider.md.txt)
-for setup instructions.
+[App Check for Firebase AI Logic](https://firebase.google.com/docs/ai-logic/app-check.md.txt)
+for setup instructions. Each platform uses its own attestation provider, so
+follow the instructions for the target platform.
 
 #### App Check Debug Tokens for Local Development & CI/CD
 
@@ -138,70 +214,82 @@
 reject emulators, simulators, or CI environments, you must use **App Check Debug
 Tokens** during development and testing to bypass standard attestation.
 
+> [!WARNING] **CRITICAL: Never Hardcode or Commit Debug Tokens** App Check debug
+> tokens allow clients to bypass attestation and access backend resources
+> without a genuine device. Treat them as private secrets. **Never commit debug
+> tokens to version control or hardcode raw token strings in client code** (Web,
+> Android, iOS, or Flutter). Always inject them through local environment
+> variables, gitignored local configurations, or CI secrets. If a token is
+> compromised, revoke it immediately in the Firebase Console.
+
 ##### Local Development (Auto-Generated)
 
-1.  Configure your code's App Check provider to use the debug factory:
-    *   **Web**: Set `self.FIREBASE_APPCHECK_DEBUG_TOKEN = true;` before
-        initializing App Check.
-    *   **Android**: Install `DebugAppCheckProviderFactory.getInstance()`.
-    *   **iOS**: Set provider factory to `AppCheckDebugProviderFactory()`.
-2.  Run your app in the emulator/localhost.
-3.  Look at your runtime debugger console / Logcat logs for the generated UUID:
-    *   *Example:* `AppCheck debug token:
-        "123a4567-b89c-12d3-e456-789012345678"`
-4.  Register this token in the Firebase Console under **Security > App Check >
-    Apps > Manage debug tokens**.
+1. Configure your code's App Check provider to use the debug factory. The API is
+   platform-specific; see the App Check section of the platform reference or the
+   App Check documentation linked above.
+1. Run your app in the emulator/localhost.
+1. Look at your runtime debugger console / Logcat logs for the generated UUID:
+   - *Example:* `AppCheck debug token: "123a4567-b89c-12d3-e456-789012345678"`
+1. Register this token in the Firebase Console under **Security > App Check >
+   Apps > Manage debug tokens**.
+
+> **💡 Tip (Prevent Debug Token Churn):** Simulator or emulator resets, fresh
+> installs, and clearing browser data can make the SDK generate a new debug
+> token that you must register again. To keep a stable debug token without
+> hardcoding it, see the App Check section of the platform reference.
 
 ##### CI/CD Pipelines (Pre-Provisioned)
 
-1.  Generate and register a new debug token in the Firebase Console under
-    **Security > App Check > Apps > Manage debug tokens**.
-2.  Add this token string as an encrypted secret in your CI system (e.g.
-    `APP_CHECK_DEBUG_TOKEN`).
-3.  Configure your build to pass this secret as an environment variable to the
-    SDK during test execution (e.g. `self.FIREBASE_APPCHECK_DEBUG_TOKEN =
-    process.env.APP_CHECK_DEBUG_TOKEN`).
+1. Generate and register a new debug token in the Firebase Console under
+   **Security > App Check > Apps > Manage debug tokens**.
+1. Add this token string as an encrypted secret in your CI system (e.g.
+   `APP_CHECK_DEBUG_TOKEN`).
+1. Configure your build to pass this secret as an environment variable to the
+   SDK during test execution.
 
-### Remote Config
+### Firebase Remote Config
 
 Consider that you do not need to hardcode model names (e.g., a specific model
 version string). Use Firebase Remote Config to update model versions dynamically
 without deploying new client code. See
 [Changing model names remotely](https://firebase.google.com/docs/ai-logic/change-model-name-remotely.md.txt)
 
-> [!WARNING] **CRITICAL: Backend Provisioning Required** For all platforms
-> (Flutter, Android, iOS, Web), you MUST run `npx firebase-tools init ailogic`
-> to provision the service. `flutterfire configure` ONLY handles client
-> configuration and does NOT enable the AI service, leading to
-> `PERMISSION_DENIED` errors.
+______________________________________________________________________
 
 ## Initialization Code References
 
-| Language,   | Gemini API | Context URL                                     |
-: Framework,  : provider   :                                                 :
-: Platform    :            :                                                 :
-| :---------- | :--------- | :---------------------------------------------- |
-| Web Modular | Gemini     | firebase://docs/ai-logic/get-started            |
-: API         : Developer  :                                                 :
-:             : API        :                                                 :
-:             : (Developer :                                                 :
-:             : API)       :                                                 :
-| iOS (Swift) | Gemini     | [ios_setup.md](references/ios_setup.md)         |
-:             : Developer  :                                                 :
-:             : API        :                                                 :
-| Flutter     | Gemini     | [flutter_setup.md](references/flutter_setup.md) |
-: (Dart)      : Developer  :                                                 :
-:             : API        :                                                 :
+- **Android (Kotlin)**
+
+  - Gemini API Provider: Gemini Developer API
+  - Reference: [usage_patterns_android.md](references/usage_patterns_android.md)
+
+- **iOS (Swift)**
+
+  - Gemini API Provider: Gemini Developer API
+  - Reference: [ios_setup.md](references/ios_setup.md)
+
+- **Web Modular API**
+
+  - Gemini API Provider: Gemini Developer API
+  - Reference: [usage_patterns_web.md](references/usage_patterns_web.md)
+
+- **Flutter (Dart)**
+
+  - Gemini API Provider: Gemini Developer API
+  - Reference: [flutter_setup.md](references/flutter_setup.md)
 
 > [!WARNING] **CRITICAL: Use current model names:** Always check the
 > [Firebase AI Logic Models documentation](https://firebase.google.com/docs/ai-logic/models.md.txt)
-> for the currently supported model names. Do NOT use `gemini-2.0-pro` or
-> `gemini-2.0-flash` or other older models that are shutdown.
+> for the currently supported model names. Do NOT use any Gemini 1.x or Gemini
+> 2.x models (such as `gemini-1.5-flash`, `gemini-2.0-flash`,
+> `gemini-2.5-flash`, or `gemini-2.5-flash-lite`), as older models are
+> deprecated or shut down.
 
 ## References
 
-[Web SDK code examples and usage patterns](references/usage_patterns_web.md)
+[Android (Kotlin) SDK usage patterns](references/usage_patterns_android.md)
 [iOS SDK code examples and usage patterns](references/ios_setup.md)
-[Flutter SDK code examples and usage patterns](references/flutter_setup.md)
+[Web SDK setup, code examples, and usage patterns](references/usage_patterns_web.md)
 
-[Android (Kotlin) SDK usage patterns](references/usage_patterns_android.md)
+[Flutter SDK code examples and usage patterns](references/flutter_setup.md)
+[Client-side Text-to-Speech (TTS) generation](references/tts_generation.md)
Full technical diff · 3 changed fields

changed /description

BEFORE
"Official skill for integrating Firebase AI Logic (Gemini API) into web applications. Covers setup, multimodal inference, structured output, and security."
AFTER
"Integrates Firebase AI Logic (formerly Vertex AI for Firebase) into mobile and web apps (Android, iOS, Web, and Flutter) to call Gemini models from client code. Use when provisioning or initializing Firebase AI Logic, or adding Gemini features to an app: text generation, multimodal input, chat, streaming, structured output, hybrid on-device inference, App Check protection, or switching models with Remote Config."

changed /included_files

BEFORE
[
  {
    "relative_path": "references/flutter_setup.md",
    "size_in_bytes": 3335
  },
  {
    "relative_path": "references/ios_setup.md",
    "size_in_bytes": 4834
  },
  {
    "relative_path": "references/usage_patterns_android.md",
    "size_in_bytes": 4545
  },
  {
    "relative_path": "references/usage_patterns_web.md",
    "size_in_bytes": 5450
  }
]
AFTER
[
  {
    "relative_path": "references/flutter_setup.md",
    "size_in_bytes": 5169
  },
  {
    "relative_path": "references/ios_setup.md",
    "size_in_bytes": 8275
  },
  {
    "relative_path": "references/tts_generation.md",
    "size_in_bytes": 22260
  },
  {
    "relative_path": "references/usage_patterns_android.md",
    "size_in_bytes": 7359
  },
  {
    "relative_path": "references/usage_patterns_web.md",
    "size_in_bytes": 8804
  }
]

changed /skill_md_contents

BEFORE
"---\nname: firebase-ai-logic-basics\ndescription: Official skill for integrating Firebase AI Logic (Gemini API) into web applications. Covers setup, multimodal inference, structured output, and security.\nversion: 1.0.1\nmetadata:\n  category: AiAndMachineLearning\n---\n\n# Firebase AI Logic Basics\n\n## Overview\n\nFirebase AI Logic is a product of Firebase that allows developers to add gen AI\nto their mobile and web apps using client-side SDKs. You can call Gemini models\ndirectly from your app without managing a dedicated backend. Firebase AI Logic,\nwhich was previously known as \"Vertex AI for Firebase\", represents the evolution\nof Google's AI integration platform for mobile and web developers.\n\nIt supports the two Gemini API providers:\n\n-   **Gemini Developer API**: It has a free tier ideal for prototyping, and\n    pay-as-you-go for production\n-   **Agent Platform Gemini API** (formerly branded Vertex AI): Ideal for scale\n    with enterprise-grade production readiness, requires Blaze plan\n\nUse the Gemini Developer API as a default, and only Agent Platform Gemini API\n(formerly branded Vertex AI) if the application requires it.\n\n## Setup & Initialization\n\n### Prerequisites\n\n-   Before starting, ensure you have **Node.js 16+** and npm installed. Install\n    them if they aren’t already available.\n-   Identify the platform the user is interested in building on prior to\n    starting: Android, iOS, Flutter or Web.\n-   If their platform is unsupported, Direct the user to Firebase Docs to learn\n    how to set up AI Logic for their application (share this link with the user\n    https://firebase.google.com/docs/ai-logic/get-started)\n\n### Installation\n\nThe library is part of the standard Firebase Web SDK.\n\n`npm install -g firebase@latest`\n\nIf you're in a firebase directory (with a firebase.json) the currently selected\nproject will be marked with \"current\" using this command:\n\n`npx -y firebase-tools@latest projects:list`\n\nEnsure there's at least one app associated with the current project\n\n`npx -y firebase-tools@latest apps:list`\n\nInitialize AI logic SDK with the init command\n\n`npx -y firebase-tools@latest init ailogic`\n\nThis will automatically enable the Gemini Developer API in the Firebase console.\n\nMore info in\n[Firebase AI Logic Getting Started](https://firebase.google.com/docs/ai-logic/get-started.md.txt)\n\n## Core Capabilities\n\n> [!WARNING] **CRITICAL: Use current model names:** Always check the\n> [Firebase AI Logic Models documentation](https://firebase.google.com/docs/ai-logic/models.md.txt)\n> for the currently supported model names. Do NOT use `gemini-2.0-pro` or\n> `gemini-2.0-flash` or other older models that are shutdown.\n\n### Text-Only Generation\n\n### Multimodal (Text + Images/Audio/Video/PDF input)\n\nFirebase AI Logic allows Gemini models to analyze image files directly from your\napp. This enables features like creating captions, answering questions about\nimages, detecting objects, and categorizing images. Beyond images, Gemini can\nanalyze other media types like audio, video, and PDFs by passing them as inline\ndata with their MIME type. For files larger than 20 megabytes (which can cause\nHTTP 413 errors as inline data), store them in Cloud Storage for Firebase and\npass their URLs to the Gemini Developer API.\n\n### Chat Session (Multi-turn)\n\nMaintain history automatically using `startChat`.\n\n### Streaming Responses\n\nTo improve the user experience by showing partial results as they arrive (like a\ntyping effect), use `generateContentStream` instead of `generateContent` for\nfaster display of results.\n\n### Generate Images with Nano Banana\n\n> [!WARNING] **Use current Image model names:** Always check the\n> [Firebase AI Logic Models documentation](https://firebase.google.com/docs/ai-logic/models.md.txt)\n> for the currently supported image generation (Nano Banana) model names.\n\n-   Requires an upgraded Blaze pay-as-you-go billing plan.\n\n### Search Grounding with the built in googleSearch tool\n\n## Supported Platforms and Frameworks\n\nSupported Platforms and Frameworks include Kotlin and Java for Android, Swift\nfor iOS, JavaScript for web apps, Dart for Flutter, and C Sharp for Unity.\n\n## Advanced Features\n\n### Structured Output (JSON)\n\nEnforce a specific JSON schema for the response.\n\n### On-Device AI (Hybrid)\n\nHybrid on-device inference for web apps, where the Firebase Javascript SDK\nautomatically checks for Gemini Nano's availability (after installation) and\nswitches between on-device or cloud-hosted prompt execution. This requires\nspecific steps to enable model usage in the Chrome browser, more info in the\n[hybrid-on-device-inference documentation](https://firebase.google.com/docs/ai-logic/hybrid-on-device-inference.md.txt).\n\n## Security & Production\n\n### App Check\n\n> [!WARNING] **Critical Safety Requirement:** In order to use AI Logic safely,\n> you MUST set up App Check on your app. This prevents unauthorized clients from\n> using your API quota and accessing your backend resources.\n\nSee\n[App Check with reCAPTCHA Enterprise](https://firebase.google.com/docs/app-check/web/recaptcha-enterprise-provider.md.txt)\nfor setup instructions.\n\n#### App Check Debug Tokens for Local Development & CI/CD\n\nBecause App Check attestation providers (like Play Integrity or DeviceCheck)\nreject emulators, simulators, or CI environments, you must use **App Check Debug\nTokens** during development and testing to bypass standard attestation.\n\n##### Local Development (Auto-Generated)\n\n1.  Configure your code's App Check provider to use the debug factory:\n    *   **Web**: Set `self.FIREBASE_APPCHECK_DEBUG_TOKEN = true;` before\n        initializing App Check.\n    *   **Android**: Install `DebugAppCheckProviderFactory.getInstance()`.\n    *   **iOS**: Set provider factory to `AppCheckDebugProviderFactory()`.\n2.  Run your app in the emulator/localhost.\n3.  Look at your runtime debugger console / Logcat logs for the generated UUID:\n    *   *Example:* `AppCheck debug token:\n        \"123a4567-b89c-12d3-e456-789012345678\"`\n4.  Register this token in the Firebase Console under **Security > App Check >\n    Apps > Manage debug tokens**.\n\n##### CI/CD Pipelines (Pre-Provisioned)\n\n1.  Generate and register a new debug token in the Firebase Console under\n    **Security > App Check > Apps > Manage debug tokens**.\n2.  Add this token string as an encrypted secret in your CI system (e.g.\n    `APP_CHECK_DEBUG_TOKEN`).\n3.  Configure your build to pass this secret as an environment variable to the\n    SDK during test execution (e.g. `self.FIREBASE_APPCHECK_DEBUG_TOKEN =\n    process.env.APP_CHECK_DEBUG_TOKEN`).\n\n### Remote Config\n\nConsider that you do not need to hardcode model names (e.g., a specific model\nversion string). Use Firebase Remote Config to update model versions dynamically\nwithout deploying new client code. See\n[Changing model names remotely](https://firebase.google.com/docs/ai-logic/change-model-name-remotely.md.txt)\n\n> [!WARNING] **CRITICAL: Backend Provisioning Required** For all platforms\n> (Flutter, Android, iOS, Web), you MUST run `npx firebase-tools init ailogic`\n> to provision the service. `flutterfire configure` ONLY handles client\n> configuration and does NOT enable the AI service, leading to\n> `PERMISSION_DENIED` errors.\n\n## Initialization Code References\n\n| Language,   | Gemini API | Context URL                                     |\n: Framework,  : provider   :                                                 :\n: Platform    :            :                                                 :\n| :---------- | :--------- | :---------------------------------------------- |\n| Web Modular | Gemini     | firebase://docs/ai-logic/get-started            |\n: API         : Developer  :                                                 :\n:             : API        :                                                 :\n:             : (Developer :                                                 :\n:             : API)       :                                                 :\n| iOS (Swift) | Gemini     | [ios_setup.md](references/ios_setup.md)         |\n:             : Developer  :                                                 :\n:             : API        :                                                 :\n| Flutter     | Gemini     | [flutter_setup.md](references/flutter_setup.md) |\n: (Dart)      : Developer  :                                                 :\n:             : API        :                                                 :\n\n> [!WARNING] **CRITICAL: Use current model names:** Always check the\n> [Firebase AI Logic Models documentation](https://firebase.google.com/docs/ai-logic/models.md.txt)\n> for the currently supported model names. Do NOT use `gemini-2.0-pro` or\n> `gemini-2.0-flash` or other older models that are shutdown.\n\n## References\n\n[Web SDK code examples and usage patterns](references/usage_patterns_web.md)\n[iOS SDK code examples and usage patterns](references/ios_setup.md)\n[Flutter SDK code examples and usage patterns](references/flutter_setup.md)\n\n[Android (Kotlin) SDK usage patterns](references/usage_patterns_android.md)\n"
AFTER
"---\nname: firebase-ai-logic-basics\ndescription: >-\n  Integrates Firebase AI Logic (formerly Vertex AI for Firebase) into mobile and web apps (Android, iOS, Web, and Flutter) to call Gemini models from client code. Use when provisioning or initializing Firebase AI Logic, or adding Gemini features to an app: text generation, multimodal input, chat, streaming, structured output, hybrid on-device inference, App Check protection, or switching models with Remote Config.\nversion: 1.0.1\nmetadata:\n  author: Google LLC\n  category: AiAndMachineLearning\n---\n\n# Firebase AI Logic Basics\n\n## Overview\n\nFirebase AI Logic is a product of Firebase that allows developers to add gen AI\nto their mobile and web apps using client-side SDKs. The app can directly call\nGemini models via Firebase AI Logic without the developer needing to manage a\ndedicated backend. Firebase AI Logic was previously known as \"Vertex AI for\nFirebase\".\n\nIt supports the two Gemini API providers:\n\n- **Gemini Developer API**: It has a free tier ideal for prototyping, and\n  pay-as-you-go for production\n- **Agent Platform Gemini API** (formerly branded Vertex AI): Ideal for scale\n  with enterprise-grade production readiness, requires Blaze pricing plan\n\nUse the Gemini Developer API as a default, and only Agent Platform Gemini API\n(formerly branded Vertex AI) if the application requires it.\n\n______________________________________________________________________\n\n## Setup & initialization\n\n### Prerequisites\n\n- Identify the platform the user is interested in building on prior to starting:\n  Android, iOS, Web, or Flutter.\n- If their platform is unsupported, Direct the user to Firebase Docs to learn\n  how to set up AI Logic for their application (share this link with the user\n  https://firebase.google.com/docs/ai-logic/get-started)\n- The Firebase CLI commands below run through `npx` on every platform, so they\n  need **Node.js 20+** and npm. Use the `firebase-basics` skill to check for\n  them and to log in to the Firebase CLI. If Node.js is missing or older than\n  version 20, ask the user to install it as that skill describes. Don't install\n  system packages yourself, for example with `sudo apt-get`, because that\n  changes the user's machine without their consent.\n\n### 1. Provision Firebase AI Logic (ALL platforms)\n\nUse the **Firebase CLI** to provision Firebase AI Logic for the Firebase\nProject:\n\n1. Make sure that you're in a firebase directory (with a `firebase.json`).\n\n1. Verify that you're running Firebase CLI commands against the intended\n   Firebase Project. When you run this command, the active project is marked\n   with \"current\":\n\n   ```bash\n   npx -y firebase-tools@latest projects:list\n   ```\n\n1. Make sure there's at least one Firebase App for the target platform\n   registered with the current Firebase Project:\n\n   ```bash\n   npx -y firebase-tools@latest apps:list\n   ```\n\n1. Provision Firebase AI Logic for the Firebase Project:\n\n   ```bash\n   npx -y firebase-tools@latest init ailogic\n   ```\n\n   This command will enable the Gemini Developer API in the Firebase project.\n\n> [!WARNING] **CRITICAL: Provisioning Firebase AI Logic is Required** For all\n> platforms (Android, iOS, Web, or Flutter), even if the app already uses\n> Firebase, you MUST run `npx -y firebase-tools@latest init ailogic` to\n> provision the service. The configuration files of `GoogleService-Info.plist`,\n> `google-services.json`, and `firebase_options.dart` ONLY handle client\n> configuration and do NOT enable the Firebase AI Logic service, leading to\n> `PERMISSION_DENIED` errors.\n\nIf you can't run `init ailogic` yourself (for example because Node.js is missing\nor the Firebase CLI isn't logged in) do NOT skip it. The app's requests to\nGemini models will fail until the Firebase AI Logic service is provisioned. Tell\nthe user to run this command in their project directory, and include it in your\nfinal summary:\n\n```bash\nnpx -y firebase-tools@latest init ailogic\n```\n\n### 2. Add the SDK and initialize the service in the app\n\nAdding the SDK dependency and initializing the service are platform-specific.\nBefore writing code, read the reference for the target platform listed under\n[Initialization Code References](#initialization-code-references).\n\nMore info in\n[Firebase AI Logic Getting Started](https://firebase.google.com/docs/ai-logic/get-started.md.txt)\n\n______________________________________________________________________\n\n## Core Capabilities\n\n> [!WARNING] **CRITICAL: Use current model names:** Always check the\n> [Firebase AI Logic Models documentation](https://firebase.google.com/docs/ai-logic/models.md.txt)\n> for the currently supported model names. Do NOT use any Gemini 1.x or Gemini\n> 2.x models (such as `gemini-1.5-flash`, `gemini-1.5-pro`, `gemini-2.0-flash`,\n> `gemini-2.0-pro`, `gemini-2.5-flash`, `gemini-2.5-flash-lite`, or\n> `gemini-2.5-pro`), as older models are deprecated or shut down. Always use a\n> currently supported Gemini 3+ model; if URL access is blocked in your\n> environment, proceed directly without searching local files.\n\n### Text-Only Generation\n\n### Multimodal (Text + Images/Audio/Video/PDF input)\n\nFirebase AI Logic allows Gemini models to analyze image files directly from your\napp. This enables features like creating captions, answering questions about\nimages, detecting objects, and categorizing images. Beyond images, Gemini can\nanalyze other media types like audio, video, and PDFs by passing them as inline\ndata with their MIME type. For files larger than 20 megabytes (which can cause\nHTTP 413 errors as inline data), store them in Cloud Storage for Firebase and\npass their URLs to the Gemini Developer API.\n\n### Chat Session (Multi-turn)\n\nMaintain history automatically using `startChat`.\n\n### Streaming Responses\n\nTo improve the user experience by showing partial results as they arrive (like a\ntyping effect), use `generateContentStream` instead of `generateContent` for\nfaster display of results.\n\n### Text-to-Speech (TTS) Generation\n\nGenerate spoken audio directly on client devices without a custom speech\nbackend. Firebase AI Logic supports speech synthesis using dedicated Gemini TTS\nmodels:\n\n- **Supported Models**: `gemini-3.1-flash-tts-preview`\n- **Capabilities**:\n  - Single-speaker voice persona selection (`voiceName`) and multi-speaker\n    dialogues (up to 2 distinct speakers) via `SpeechConfig` /\n    `MultiSpeakerVoiceConfig`\n  - Direct audio responses by setting `responseModalities` to audio\n  - Streaming speech responses with `generateContentStream` for low-latency\n    playback\n  - Audio directives (`[Audio Profile: ...]`, `[Scene: ...]`,\n    `[Director's Note: ...]`) and emotional tags (`[whispers]`, `[laughs]`,\n    `[slowly]`)\n  - Client-side decoding and playback of 24 kHz 16-bit linear PCM (`audio/l16`)\n    or WAV container format (`audio/x-wav`)\n\nSee the [Text-to-Speech (TTS) Generation Guide](references/tts_generation.md)\nfor full implementation details, streaming patterns, and copy-paste code\nsnippets for iOS (Swift), Android (Kotlin), and Web.\n\n### Generate Images with Nano Banana\n\n> [!WARNING] **Use current Image model names:** Always check the\n> [Firebase AI Logic Models documentation](https://firebase.google.com/docs/ai-logic/models.md.txt)\n> for the currently supported image generation (Nano Banana) model names.\n\n- Requires an upgraded Blaze pay-as-you-go billing plan.\n\n### Search Grounding with the built in googleSearch tool\n\n______________________________________________________________________\n\n## Supported Platforms and Frameworks\n\nSupported Platforms and Frameworks include Kotlin and Java for Android, Swift\nfor iOS, JavaScript for web apps, Dart for Flutter, and C Sharp for Unity.\n\n## Advanced Features\n\n### Structured Output (JSON)\n\nEnforce a specific JSON schema for the response.\n\n### On-Device AI (Hybrid)\n\nHybrid inference runs prompts with an on-device model when one is available and\nfalls back to a cloud-hosted model otherwise (or vice versa). Availability and\nsetup steps differ by platform, more info in the\n[hybrid and on-device documentation](https://firebase.google.com/docs/ai-logic/hybrid.md.txt),\nwhich links to each platform's guide.\n\n______________________________________________________________________\n\n## Security & Production\n\n### Firebase App Check\n\n> [!WARNING] **Critical Safety Requirement:** In order to use AI Logic safely,\n> you MUST set up App Check on your app. This prevents unauthorized clients from\n> using your API quota and accessing your backend resources.\n\nSee\n[App Check for Firebase AI Logic](https://firebase.google.com/docs/ai-logic/app-check.md.txt)\nfor setup instructions. Each platform uses its own attestation provider, so\nfollow the instructions for the target platform.\n\n#### App Check Debug Tokens for Local Development & CI/CD\n\nBecause App Check attestation providers (like Play Integrity or DeviceCheck)\nreject emulators, simulators, or CI environments, you must use **App Check Debug\nTokens** during development and testing to bypass standard attestation.\n\n> [!WARNING] **CRITICAL: Never Hardcode or Commit Debug Tokens** App Check debug\n> tokens allow clients to bypass attestation and access backend resources\n> without a genuine device. Treat them as private secrets. **Never commit debug\n> tokens to version control or hardcode raw token strings in client code** (Web,\n> Android, iOS, or Flutter). Always inject them through local environment\n> variables, gitignored local configurations, or CI secrets. If a token is\n> compromised, revoke it immediately in the Firebase Console.\n\n##### Local Development (Auto-Generated)\n\n1. Configure your code's App Check provider to use the debug factory. The API is\n   platform-specific; see the App Check section of the platform reference or the\n   App Check documentation linked above.\n1. Run your app in the emulator/localhost.\n1. Look at your runtime debugger console / Logcat logs for the generated UUID:\n   - *Example:* `AppCheck debug token: \"123a4567-b89c-12d3-e456-789012345678\"`\n1. Register this token in the Firebase Console under **Security > App Check >\n   Apps > Manage debug tokens**.\n\n> **💡 Tip (Prevent Debug Token Churn):** Simulator or emulator resets, fresh\n> installs, and clearing browser data can make the SDK generate a new debug\n> token that you must register again. To keep a stable debug token without\n> hardcoding it, see the App Check section of the platform reference.\n\n##### CI/CD Pipelines (Pre-Provisioned)\n\n1. Generate and register a new debug token in the Firebase Console under\n   **Security > App Check > Apps > Manage debug tokens**.\n1. Add this token string as an encrypted secret in your CI system (e.g.\n   `APP_CHECK_DEBUG_TOKEN`).\n1. Configure your build to pass this secret as an environment variable to the\n   SDK during test execution.\n\n### Firebase Remote Config\n\nConsider that you do not need to hardcode model names (e.g., a specific model\nversion string). Use Firebase Remote Config to update model versions dynamically\nwithout deploying new client code. See\n[Changing model names remotely](https://firebase.google.com/docs/ai-logic/change-model-name-remotely.md.txt)\n\n______________________________________________________________________\n\n## Initialization Code References\n\n- **Android (Kotlin)**\n\n  - Gemini API Provider: Gemini Developer API\n  - Reference: [usage_patterns_android.md](references/usage_patterns_android.md)\n\n- **iOS (Swift)**\n\n  - Gemini API Provider: Gemini Developer API\n  - Reference: [ios_setup.md](references/ios_setup.md)\n\n- **Web Modular API**\n\n  - Gemini API Provider: Gemini Developer API\n  - Reference: [usage_patterns_web.md](references/usage_patterns_web.md)\n\n- **Flutter (Dart)**\n\n  - Gemini API Provider: Gemini Developer API\n  - Reference: [flutter_setup.md](references/flutter_setup.md)\n\n> [!WARNING] **CRITICAL: Use current model names:** Always check the\n> [Firebase AI Logic Models documentation](https://firebase.google.com/docs/ai-logic/models.md.txt)\n> for the currently supported model names. Do NOT use any Gemini 1.x or Gemini\n> 2.x models (such as `gemini-1.5-flash`, `gemini-2.0-flash`,\n> `gemini-2.5-flash`, or `gemini-2.5-flash-lite`), as older models are\n> deprecated or shut down.\n\n## References\n\n[Android (Kotlin) SDK usage patterns](references/usage_patterns_android.md)\n[iOS SDK code examples and usage patterns](references/ios_setup.md)\n[Web SDK setup, code examples, and usage patterns](references/usage_patterns_web.md)\n\n[Flutter SDK code examples and usage patterns](references/flutter_setup.md)\n[Client-side Text-to-Speech (TTS) generation](references/tts_generation.md)\n"
Full snapshot data
{
  "description": "Integrates Firebase AI Logic (formerly Vertex AI for Firebase) into mobile and web apps (Android, iOS, Web, and Flutter) to call Gemini models from client code. Use when provisioning or initializing Firebase AI Logic, or adding Gemini features to an app: text generation, multimodal input, chat, streaming, structured output, hybrid on-device inference, App Check protection, or switching models with Remote Config.",
  "included_files": [
    {
      "relative_path": "references/flutter_setup.md",
      "size_in_bytes": 5169
    },
    {
      "relative_path": "references/ios_setup.md",
      "size_in_bytes": 8275
    },
    {
      "relative_path": "references/tts_generation.md",
      "size_in_bytes": 22260
    },
    {
      "relative_path": "references/usage_patterns_android.md",
      "size_in_bytes": 7359
    },
    {
      "relative_path": "references/usage_patterns_web.md",
      "size_in_bytes": 8804
    }
  ],
  "name": "firebase-ai-logic-basics",
  "skill_md_contents": "---\nname: firebase-ai-logic-basics\ndescription: >-\n  Integrates Firebase AI Logic (formerly Vertex AI for Firebase) into mobile and web apps (Android, iOS, Web, and Flutter) to call Gemini models from client code. Use when provisioning or initializing Firebase AI Logic, or adding Gemini features to an app: text generation, multimodal input, chat, streaming, structured output, hybrid on-device inference, App Check protection, or switching models with Remote Config.\nversion: 1.0.1\nmetadata:\n  author: Google LLC\n  category: AiAndMachineLearning\n---\n\n# Firebase AI Logic Basics\n\n## Overview\n\nFirebase AI Logic is a product of Firebase that allows developers to add gen AI\nto their mobile and web apps using client-side SDKs. The app can directly call\nGemini models via Firebase AI Logic without the developer needing to manage a\ndedicated backend. Firebase AI Logic was previously known as \"Vertex AI for\nFirebase\".\n\nIt supports the two Gemini API providers:\n\n- **Gemini Developer API**: It has a free tier ideal for prototyping, and\n  pay-as-you-go for production\n- **Agent Platform Gemini API** (formerly branded Vertex AI): Ideal for scale\n  with enterprise-grade production readiness, requires Blaze pricing plan\n\nUse the Gemini Developer API as a default, and only Agent Platform Gemini API\n(formerly branded Vertex AI) if the application requires it.\n\n______________________________________________________________________\n\n## Setup & initialization\n\n### Prerequisites\n\n- Identify the platform the user is interested in building on prior to starting:\n  Android, iOS, Web, or Flutter.\n- If their platform is unsupported, Direct the user to Firebase Docs to learn\n  how to set up AI Logic for their application (share this link with the user\n  https://firebase.google.com/docs/ai-logic/get-started)\n- The Firebase CLI commands below run through `npx` on every platform, so they\n  need **Node.js 20+** and npm. Use the `firebase-basics` skill to check for\n  them and to log in to the Firebase CLI. If Node.js is missing or older than\n  version 20, ask the user to install it as that skill describes. Don't install\n  system packages yourself, for example with `sudo apt-get`, because that\n  changes the user's machine without their consent.\n\n### 1. Provision Firebase AI Logic (ALL platforms)\n\nUse the **Firebase CLI** to provision Firebase AI Logic for the Firebase\nProject:\n\n1. Make sure that you're in a firebase directory (with a `firebase.json`).\n\n1. Verify that you're running Firebase CLI commands against the intended\n   Firebase Project. When you run this command, the active project is marked\n   with \"current\":\n\n   ```bash\n   npx -y firebase-tools@latest projects:list\n   ```\n\n1. Make sure there's at least one Firebase App for the target platform\n   registered with the current Firebase Project:\n\n   ```bash\n   npx -y firebase-tools@latest apps:list\n   ```\n\n1. Provision Firebase AI Logic for the Firebase Project:\n\n   ```bash\n   npx -y firebase-tools@latest init ailogic\n   ```\n\n   This command will enable the Gemini Developer API in the Firebase project.\n\n> [!WARNING] **CRITICAL: Provisioning Firebase AI Logic is Required** For all\n> platforms (Android, iOS, Web, or Flutter), even if the app already uses\n> Firebase, you MUST run `npx -y firebase-tools@latest init ailogic` to\n> provision the service. The configuration files of `GoogleService-Info.plist`,\n> `google-services.json`, and `firebase_options.dart` ONLY handle client\n> configuration and do NOT enable the Firebase AI Logic service, leading to\n> `PERMISSION_DENIED` errors.\n\nIf you can't run `init ailogic` yourself (for example because Node.js is missing\nor the Firebase CLI isn't logged in) do NOT skip it. The app's requests to\nGemini models will fail until the Firebase AI Logic service is provisioned. Tell\nthe user to run this command in their project directory, and include it in your\nfinal summary:\n\n```bash\nnpx -y firebase-tools@latest init ailogic\n```\n\n### 2. Add the SDK and initialize the service in the app\n\nAdding the SDK dependency and initializing the service are platform-specific.\nBefore writing code, read the reference for the target platform listed under\n[Initialization Code References](#initialization-code-references).\n\nMore info in\n[Firebase AI Logic Getting Started](https://firebase.google.com/docs/ai-logic/get-started.md.txt)\n\n______________________________________________________________________\n\n## Core Capabilities\n\n> [!WARNING] **CRITICAL: Use current model names:** Always check the\n> [Firebase AI Logic Models documentation](https://firebase.google.com/docs/ai-logic/models.md.txt)\n> for the currently supported model names. Do NOT use any Gemini 1.x or Gemini\n> 2.x models (such as `gemini-1.5-flash`, `gemini-1.5-pro`, `gemini-2.0-flash`,\n> `gemini-2.0-pro`, `gemini-2.5-flash`, `gemini-2.5-flash-lite`, or\n> `gemini-2.5-pro`), as older models are deprecated or shut down. Always use a\n> currently supported Gemini 3+ model; if URL access is blocked in your\n> environment, proceed directly without searching local files.\n\n### Text-Only Generation\n\n### Multimodal (Text + Images/Audio/Video/PDF input)\n\nFirebase AI Logic allows Gemini models to analyze image files directly from your\napp. This enables features like creating captions, answering questions about\nimages, detecting objects, and categorizing images. Beyond images, Gemini can\nanalyze other media types like audio, video, and PDFs by passing them as inline\ndata with their MIME type. For files larger than 20 megabytes (which can cause\nHTTP 413 errors as inline data), store them in Cloud Storage for Firebase and\npass their URLs to the Gemini Developer API.\n\n### Chat Session (Multi-turn)\n\nMaintain history automatically using `startChat`.\n\n### Streaming Responses\n\nTo improve the user experience by showing partial results as they arrive (like a\ntyping effect), use `generateContentStream` instead of `generateContent` for\nfaster display of results.\n\n### Text-to-Speech (TTS) Generation\n\nGenerate spoken audio directly on client devices without a custom speech\nbackend. Firebase AI Logic supports speech synthesis using dedicated Gemini TTS\nmodels:\n\n- **Supported Models**: `gemini-3.1-flash-tts-preview`\n- **Capabilities**:\n  - Single-speaker voice persona selection (`voiceName`) and multi-speaker\n    dialogues (up to 2 distinct speakers) via `SpeechConfig` /\n    `MultiSpeakerVoiceConfig`\n  - Direct audio responses by setting `responseModalities` to audio\n  - Streaming speech responses with `generateContentStream` for low-latency\n    playback\n  - Audio directives (`[Audio Profile: ...]`, `[Scene: ...]`,\n    `[Director's Note: ...]`) and emotional tags (`[whispers]`, `[laughs]`,\n    `[slowly]`)\n  - Client-side decoding and playback of 24 kHz 16-bit linear PCM (`audio/l16`)\n    or WAV container format (`audio/x-wav`)\n\nSee the [Text-to-Speech (TTS) Generation Guide](references/tts_generation.md)\nfor full implementation details, streaming patterns, and copy-paste code\nsnippets for iOS (Swift), Android (Kotlin), and Web.\n\n### Generate Images with Nano Banana\n\n> [!WARNING] **Use current Image model names:** Always check the\n> [Firebase AI Logic Models documentation](https://firebase.google.com/docs/ai-logic/models.md.txt)\n> for the currently supported image generation (Nano Banana) model names.\n\n- Requires an upgraded Blaze pay-as-you-go billing plan.\n\n### Search Grounding with the built in googleSearch tool\n\n______________________________________________________________________\n\n## Supported Platforms and Frameworks\n\nSupported Platforms and Frameworks include Kotlin and Java for Android, Swift\nfor iOS, JavaScript for web apps, Dart for Flutter, and C Sharp for Unity.\n\n## Advanced Features\n\n### Structured Output (JSON)\n\nEnforce a specific JSON schema for the response.\n\n### On-Device AI (Hybrid)\n\nHybrid inference runs prompts with an on-device model when one is available and\nfalls back to a cloud-hosted model otherwise (or vice versa). Availability and\nsetup steps differ by platform, more info in the\n[hybrid and on-device documentation](https://firebase.google.com/docs/ai-logic/hybrid.md.txt),\nwhich links to each platform's guide.\n\n______________________________________________________________________\n\n## Security & Production\n\n### Firebase App Check\n\n> [!WARNING] **Critical Safety Requirement:** In order to use AI Logic safely,\n> you MUST set up App Check on your app. This prevents unauthorized clients from\n> using your API quota and accessing your backend resources.\n\nSee\n[App Check for Firebase AI Logic](https://firebase.google.com/docs/ai-logic/app-check.md.txt)\nfor setup instructions. Each platform uses its own attestation provider, so\nfollow the instructions for the target platform.\n\n#### App Check Debug Tokens for Local Development & CI/CD\n\nBecause App Check attestation providers (like Play Integrity or DeviceCheck)\nreject emulators, simulators, or CI environments, you must use **App Check Debug\nTokens** during development and testing to bypass standard attestation.\n\n> [!WARNING] **CRITICAL: Never Hardcode or Commit Debug Tokens** App Check debug\n> tokens allow clients to bypass attestation and access backend resources\n> without a genuine device. Treat them as private secrets. **Never commit debug\n> tokens to version control or hardcode raw token strings in client code** (Web,\n> Android, iOS, or Flutter). Always inject them through local environment\n> variables, gitignored local configurations, or CI secrets. If a token is\n> compromised, revoke it immediately in the Firebase Console.\n\n##### Local Development (Auto-Generated)\n\n1. Configure your code's App Check provider to use the debug factory. The API is\n   platform-specific; see the App Check section of the platform reference or the\n   App Check documentation linked above.\n1. Run your app in the emulator/localhost.\n1. Look at your runtime debugger console / Logcat logs for the generated UUID:\n   - *Example:* `AppCheck debug token: \"123a4567-b89c-12d3-e456-789012345678\"`\n1. Register this token in the Firebase Console under **Security > App Check >\n   Apps > Manage debug tokens**.\n\n> **💡 Tip (Prevent Debug Token Churn):** Simulator or emulator resets, fresh\n> installs, and clearing browser data can make the SDK generate a new debug\n> token that you must register again. To keep a stable debug token without\n> hardcoding it, see the App Check section of the platform reference.\n\n##### CI/CD Pipelines (Pre-Provisioned)\n\n1. Generate and register a new debug token in the Firebase Console under\n   **Security > App Check > Apps > Manage debug tokens**.\n1. Add this token string as an encrypted secret in your CI system (e.g.\n   `APP_CHECK_DEBUG_TOKEN`).\n1. Configure your build to pass this secret as an environment variable to the\n   SDK during test execution.\n\n### Firebase Remote Config\n\nConsider that you do not need to hardcode model names (e.g., a specific model\nversion string). Use Firebase Remote Config to update model versions dynamically\nwithout deploying new client code. See\n[Changing model names remotely](https://firebase.google.com/docs/ai-logic/change-model-name-remotely.md.txt)\n\n______________________________________________________________________\n\n## Initialization Code References\n\n- **Android (Kotlin)**\n\n  - Gemini API Provider: Gemini Developer API\n  - Reference: [usage_patterns_android.md](references/usage_patterns_android.md)\n\n- **iOS (Swift)**\n\n  - Gemini API Provider: Gemini Developer API\n  - Reference: [ios_setup.md](references/ios_setup.md)\n\n- **Web Modular API**\n\n  - Gemini API Provider: Gemini Developer API\n  - Reference: [usage_patterns_web.md](references/usage_patterns_web.md)\n\n- **Flutter (Dart)**\n\n  - Gemini API Provider: Gemini Developer API\n  - Reference: [flutter_setup.md](references/flutter_setup.md)\n\n> [!WARNING] **CRITICAL: Use current model names:** Always check the\n> [Firebase AI Logic Models documentation](https://firebase.google.com/docs/ai-logic/models.md.txt)\n> for the currently supported model names. Do NOT use any Gemini 1.x or Gemini\n> 2.x models (such as `gemini-1.5-flash`, `gemini-2.0-flash`,\n> `gemini-2.5-flash`, or `gemini-2.5-flash-lite`), as older models are\n> deprecated or shut down.\n\n## References\n\n[Android (Kotlin) SDK usage patterns](references/usage_patterns_android.md)\n[iOS SDK code examples and usage patterns](references/ios_setup.md)\n[Web SDK setup, code examples, and usage patterns](references/usage_patterns_web.md)\n\n[Flutter SDK code examples and usage patterns](references/flutter_setup.md)\n[Client-side Text-to-Speech (TTS) generation](references/tts_generation.md)\n"
}

SHA-256 of public snapshot: 0b8749cfc9867e4e515057abfb155b0af462f235c4d47484348029cedad6bb90