firebase-remote-config-basics

โดย firebase

Comprehensive guide for Firebase Remote Config, including template management and SDK usage. Use this skill when the user needs help setting up Remote Config, managing feature flags, or updating app behavior dynamically.

npx skills add https://github.com/firebase/agent-skills --skill firebase-remote-config-basics

Remote Config

This skill provides a complete guide for getting started with Remote Config on Android or iOS. Remote Config allows you to change the behavior and appearance of your app without publishing an app update by maintaining a cloud-based configuration template.

Prerequisites

Provisioning Remote Config requires both a Firebase project and a Firebase app, either Android or iOS. To manage the Remote Config template and conditions via the command line, use the Firebase CLI. See the firebase-basics skill for references on project initialization.

Troubleshooting Execution

Handling npx 403 Forbidden Errors

If npx -y firebase-tools@latest fails due to registry permissions (403 error):

  1. Inform the user: "I am unable to fetch the latest Firebase tools via npx due to a registry error."
  2. Fallback: Attempt to use the local firebase command directly if the user confirms it is installed globally (npm install -g firebase-tools).

Handling Project Context Issues

If a command fails because "no active project is selected":

  1. Check login: Run npx -y firebase-tools@latest login:list.
  2. Prompt for ID: If logged in but no project is active, ask the user: "Please provide your Firebase Project ID to proceed."
  3. Use Flag: Append --project <PROJECT_ID> to every subsequent command.

SDK Setup

To learn how to set up Remote Config in your application code, choose your platform:

Best Practices and Template Management

Follow these guidelines and use the associated CLI tools to ensure efficient and safe use of Remote Config.

Fetching Strategies

To optimize app performance and user experience, follow these recommended patterns (see Loading Strategies):

  • Load new values for next startup: The most effective pattern is to activate previously fetched values immediately on startup and fetch new values in the background to be used next time. This minimizes user wait time.
  • Real-time Updates: Use the SDK's real-time listener to update the app instantly without a refresh when server-side configuration changes.

Template Management via CLI

Use the following commands to manage your Remote Config template and version history through the terminal:

Template Management via CLI

Use the following commands to manage your Remote Config template and version history through the terminal:

  • Get current template: Save the remote template to a local JSON file for auditing or modification.

    npx -y firebase-tools@latest remoteconfig:get -o remote_config.json
    
  • Autonomous Editing & Discovery : Modify the local remote_config.json directly. Determine the correct signal (e.g., device.country or percent) and update the "conditions" array and "parameters" map accordingly.

  • MANDATORY: User Review and Verification : STOP and ask the user to verify your changes before proceeding to deployment.

    • Action: Inform the user: "I have prepared the changes in remote_config.json. Please review the file for accuracy. Once you are satisfied, tell me to 'deploy' to make the changes live."
  • Deployment Orchestration : To push changes, you must ensure the environment is configured for deployment.

    • Config Mapping: If a firebase.json file is missing, create one to map the local JSON to the Remote Config service:
      { "remoteconfig": { "template": "remote_config.json" } }
    
    • Deploy: Execute the partial deployment command
      npx -y firebase-tools@latest deploy --only remoteconfig
      
  • Verification: After deployment, verify the update by listing the version history.

    npx -y firebase-tools@latest remoteconfig:versions:list
    

The SDK provides a number of features to make your application dynamic and responsive to user segments.

  • Set In-App Defaults: Define baseline values to ensure the app functions offline or before the first fetch.
  • Fetch and Activate: Retrieve values from the Firebase backend and apply them to the local UI/Logic.
  • Template Management: Use the Firebase CLI to version-control, get, and deploy your config JSON files.

Skills เพิ่มเติมจาก firebase

developing-genkit-dart
firebase
Unified AI SDK สำหรับ Dart ที่รองรับการสร้างโค้ด, ผลลัพธ์ที่มีโครงสร้าง, เครื่องมือ, โฟลว์, และเอเจนต์ ให้ API หลักสำหรับการสร้าง, การกำหนดเครื่องมือ, การจัดระเบียบโฟลว์, การฝังข้อมูล, และการสตรีมด้วยอินเทอร์เฟซเดียว รวมถึงปลั๊กอิน 8+ ตัวสำหรับผู้ให้บริการ LLM (Google Gemini, Anthropic Claude, OpenAI GPT), Firebase AI, Model Context Protocol, การรวมเบราว์เซอร์ Chrome, และการโฮสต์เซิร์ฟเวอร์ HTTP ผ่าน Shelf มี CLI ในตัวพร้อม UI สำหรับการพัฒนาในเครื่องสำหรับการดำเนินการโฟลว์, การติดตาม, การทดลองโมเดล, และ...
official
developing-genkit-go
firebase
พัฒนาแอปพลิเคชันที่ขับเคลื่อนด้วย AI โดยใช้ Genkit ใน Go ใช้เมื่อผู้ใช้ขอให้สร้างฟีเจอร์ AI, เอเจนต์, โฟลว์ หรือเครื่องมือใน Go โดยใช้ Genkit หรือเมื่อทำงาน...
official
developing-genkit-js
firebase
สร้างแอปพลิเคชัน Node.js/TypeScript ที่ขับเคลื่อนด้วย AI ด้วย Genkit flows, tools และการรองรับหลายโมเดล Genkit ไม่ยึดติดกับผู้ให้บริการ รองรับ Google AI, OpenAI, Anthropic, Ollama และผู้ให้บริการ LLM อื่นๆ ผ่านปลั๊กอิน กำหนด flows ด้วยสคีมาที่ปลอดภัยชนิดข้อมูลโดยใช้ Zod ดำเนินการสร้างคำขอ และประกอบเวิร์กโฟลว์ AI แบบหลายขั้นตอนใน TypeScript ต้องใช้ Genkit CLI v1.29.0+ การเปลี่ยนแปลง API หลักเมื่อเร็วๆ นี้หมายความว่าคุณต้องปรึกษา genkit docs:read และ common-errors.md สำหรับรูปแบบปัจจุบัน ไม่ใช่ความรู้เดิม...
official
developing-genkit-python
firebase
พัฒนาแอปพลิเคชันที่ขับเคลื่อนด้วย AI โดยใช้ Genkit ใน Python ใช้เมื่อผู้ใช้ถามเกี่ยวกับ Genkit, เอเจนต์ AI, โฟลว์ หรือเครื่องมือใน Python หรือเมื่อพบ Genkit…
official
firebase-ai-logic
firebase
การผสานรวม Gemini ฝั่งไคลเอ็นต์สำหรับเว็บแอปพลิเคชัน รองรับการอนุมานแบบหลายรูปแบบ การสตรีม และการทำงานแบบไฮบริดบนอุปกรณ์ รองรับอินพุตแบบข้อความเท่านั้นและแบบหลายรูปแบบ (รูปภาพ เสียง วิดีโอ PDF) ไฟล์ที่เกิน 20 MB จะถูกส่งผ่าน Cloud Storage รวมถึงเซสชันแชทที่มีประวัติอัตโนมัติ การตอบสนองแบบสตรีมสำหรับการแสดงผลแบบเรียลไทม์ และการบังคับใช้เอาต์พุต JSON ที่มีโครงสร้าง รองรับการอนุมานแบบไฮบริดบนอุปกรณ์ผ่าน Gemini Nano ใน Chrome โดยจะเปลี่ยนไปใช้การทำงานบนคลาวด์โดยอัตโนมัติ ต้องใช้ App Check สำหรับการใช้งานจริง...
official
firebase-ai-logic-basics
firebase
ทักษะอย่างเป็นทางการสำหรับการรวม Firebase AI Logic (Gemini API) เข้ากับเว็บแอปพลิเคชัน ครอบคลุมการตั้งค่า การอนุมานแบบหลายรูปแบบ ผลลัพธ์ที่มีโครงสร้าง และความปลอดภัย
official
firebase-app-hosting-basics
firebase
ปรับใช้และจัดการเว็บแอปแบบฟูลสแต็กด้วย Firebase App Hosting โดยใช้ Next.js, Angular และเฟรมเวิร์กอื่นๆ ที่รองรับ ต้องมีโปรเจกต์ Firebase ในแผนราคา Blaze รองรับการทำงาน Server-Side Rendering (SSR) และ Incremental Static Regeneration (ISR) ปรับใช้ผ่านการกำหนดค่า firebase.json พร้อม apphosting.yaml สำหรับตั้งค่าแบ็กเอนด์ หรือเปิดใช้งาน "git push to deploy" อัตโนมัติผ่าน GitHub รวมถึงการจัดการความลับผ่านคำสั่ง CLI เพื่อการเข้าถึงคีย์ที่ละเอียดอ่อนอย่างปลอดภัย...
official
firebase-auth-basics
firebase
ตั้งค่า Firebase Authentication กับผู้ให้บริการหลายรายและกฎการเข้าถึงข้อมูลที่ปลอดภัย รองรับอีเมล/รหัสผ่าน, เบอร์โทรศัพท์, ไม่ระบุตัวตน, ผู้ให้บริการแบบรวม (Google, Facebook, Twitter, GitHub, Microsoft, Apple) และการรวมระบบการยืนยันตัวตนแบบกำหนดเอง ผู้ใช้ที่ได้รับการยืนยันตัวตนแต่ละคนจะได้รับ ID เฉพาะและโทเค็นแบบ JWT (โทเค็น ID อายุสั้นและโทเค็นรีเฟรชอายุยาว) สำหรับการเข้าถึงบริการ Firebase เปิดใช้งานผู้ให้บริการผ่าน CLI สำหรับ Google Sign In, ไม่ระบุตัวตน และอีเมล/รหัสผ่าน; ใช้ Firebase Console...
official