firebase-ai-logic-basics

Integrates Firebase AI Logic Gemini API into web and mobile applications.

Updated May 5, 2026
One-click install
npx skills add https://github.com/nikegeorgian-stack/otgruzka-tovara --skill firebase-ai-logic-basics-nikegeorgian-stack
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: firebase-ai-logic-basics
Source: https://github.com/nikegeorgian-stack/otgruzka-tovara/tree/main/docs/agent-system/archive/skills/firebase-ai-logic-basics
Command: npx skills add https://github.com/nikegeorgian-stack/otgruzka-tovara --skill firebase-ai-logic-basics-nikegeorgian-stack

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires firebase, firebase-tools, and includes references (resource) components.

What problem does it solve? Adding generative AI to a client app normally requires building and securing a backend proxy for model calls. This Skill guides you through calling Gemini models directly from web, iOS, Android, and Flutter apps using the Firebase AI Logic SDK, with correct setup, security, and current model names. ## Core Features & Use Cases - Setup & Provisioning: Walks through enabling the Gemini Developer API via npx firebase-tools init ailogic, choosing between the Gemini Developer API and Vertex AI Gemini API providers. - Core Inference Patterns: Covers text generation, multimodal input (images, audio, video, PDF), multi-turn chat sessions, streaming responses, image generation, and structured JSON output with schemas. - Security & Production Readiness: Enforces App Check setup (including debug tokens for local dev and CI/CD) and Remote Config for updating model names without redeploying. - Use Case: You are building a web app that analyzes uploaded photos. Use this Skill to initialize the Firebase AI SDK, send the image as inline base64 data with a prompt, and stream the Gemini response back to the UI. ## Quick Start Ask the assistant to set up Firebase AI Logic in your web app and generate text from a prompt using the Gemini Developer API.

Frequently Asked Questions about firebase-ai-logic-basics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add Gemini AI to my web app with Firebase?▼

Install the Firebase Web SDK, run npx firebase-tools init ailogic to enable the Gemini Developer API, then call getAI(app) and getGenerativeModel with a current model name. You can then use generateContent for text or multimodal prompts directly from the client.

What is the difference between Gemini Developer API and Vertex AI Gemini API?▼

The Gemini Developer API offers a free tier for prototyping and pay-as-you-go pricing, making it the default choice. The Vertex AI Gemini API targets enterprise-scale production workloads and requires a Blaze billing plan.

Does Firebase AI Logic support Flutter and iOS?▼

Yes, it supports Flutter via the firebase_ai package, iOS via the FirebaseAILogic Swift SDK, Android via the firebase-ai Kotlin library, and web via the JavaScript SDK. Each platform has dedicated initialization patterns covered in the references.

Why do I get PERMISSION_DENIED errors with Firebase AI Logic?▼

PERMISSION_DENIED occurs when the AI service was never provisioned in your Firebase project. Running flutterfire configure only handles client configuration; you must run npx firebase-tools init ailogic to enable the backend service.

How do I handle App Check in local development and CI?▼

Use App Check debug tokens: set self.FIREBASE_APPCHECK_DEBUG_TOKEN = true locally, copy the generated UUID from console logs, and register it in the Firebase Console. For CI, pre-register a token and pass it as an environment variable secret.

Can Firebase AI Logic analyze images and PDFs?▼

Yes, Gemini models accept images, audio, video, and PDFs as inline base64 data with their MIME type. Files larger than 20 megabytes should be uploaded to Cloud Storage for Firebase and passed by URL to avoid HTTP 413 errors.