firebase-firestore-standard

Provision, secure, and integrate Cloud Firestore Standard Edition into web applications.

Updated Aug 5, 2024
One-click install
npx skills add https://github.com/nikhilkakarla/nikhilkakarla.github.io --skill firebase-firestore-standard-nikhilkakarla
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: firebase-firestore-standard
Source: https://github.com/nikhilkakarla/nikhilkakarla.github.io/tree/main/.agents/skills/firebase-firestore-standard
Command: npx skills add https://github.com/nikhilkakarla/nikhilkakarla.github.io --skill firebase-firestore-standard-nikhilkakarla

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Setting up Cloud Firestore correctly involves provisioning databases, writing secure rules, configuring indexes, and integrating the SDK—mistakes in any step can expose data or break queries. This Skill guides you through the entire Firestore Standard Edition lifecycle with security-first defaults. ## Core Features & Use Cases - Provisioning & Configuration: Create firebase.json, firestore.rules, and firestore.indexes.json manually, deploy via Firebase CLI, and run the local emulator. - Security Rules Generation: Follows a rigorous multi-phase workflow including codebase analysis, validator function patterns, RBAC guidelines, and a devil's advocate attack phase to test rules against 21 exploit vectors. - Index Management: Explains single-field vs composite indexes, query support tables, and exemption strategies for high-write or TTL fields. - Web SDK Integration: Provides modular Web SDK (v9+) patterns for reads, writes, transactions, realtime listeners, and queries. - Use Case: You are building a web app with user-generated content and need Firestore set up with locked-down security rules that prevent privilege escalation, PII leaks, and schema pollution before launch. ## Quick Start Set up Cloud Firestore in my project with secure default rules and show me how to read and write documents from my web app.

Frequently Asked Questions about firebase-firestore-standard

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

FAQPage Schema
How do I set up Cloud Firestore in my Firebase project?▼

Create firebase.json, firestore.rules, and firestore.indexes.json manually in your project root, then deploy with npx firebase-tools deploy --only firestore. Avoid firebase init since it requires interactive input.

How do I write secure Firestore security rules?▼

Start with default-deny rules, require authentication, and validate data types and field constraints on both create and update using validator functions. Never allow public reads on collections containing PII, and prevent users from modifying their own roles.

When does Firestore require a composite index?▼

Composite indexes are required for queries combining equality with range filters, multiple range filters, or array-contains with equality on different fields. The SDK throws an error with a direct console link to create the missing index.

Can I test Firestore locally without deploying?▼

Yes, run npx firebase-tools emulators:start --only firestore to start the local emulator, typically on port 8080. The Emulator UI at localhost:4000 lets you inspect data and test rules before deployment.

Why should I exempt fields from Firestore automatic indexing?▼

Exempt sequentially increasing fields like timestamps to avoid the 500 writes/second limit, and exempt large strings, arrays, or TTL fields to reduce storage costs and index churn when those fields are never queried.