Skip to main content
@capgo/capacitor-firebase-firestore Files & Storage Open source

Firebase Firestore Capacitor plugin

Capacitor plugin for Firebase Cloud Firestore

Install

bun add @capgo/capacitor-firebase-firestore bunx cap sync
npm, pnpm or yarn
  • npm install @capgo/capacitor-firebase-firestore
  • pnpm add @capgo/capacitor-firebase-firestore
  • yarn add @capgo/capacitor-firebase-firestore

Guide

How to use Firebase Firestore in Capacitor

Using @capgo/capacitor-firebase-firestore

Capacitor plugin for Firebase Cloud Firestore.

Install

bun add @capgo/capacitor-firebase-firestore
bunx cap sync

What This Plugin Exposes

  • addDocument - Adds a new document to a collection with the given data.
  • setDocument - Writes to the document referred to by the specified reference. If the document does not yet exist, it will be created.
  • getDocument - Reads the document referred to by the specified reference.
  • updateDocument - Updates fields in the document referred to by the specified reference.

Example Usage

addDocument

Adds a new document to a collection with the given data.

import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';

await FirebaseFirestore.addDocument({} as AddDocumentOptions);

setDocument

Writes to the document referred to by the specified reference. If the document does not yet exist, it will be created.

import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';

await FirebaseFirestore.setDocument({} as SetDocumentOptions);

getDocument

Reads the document referred to by the specified reference.

import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';

await FirebaseFirestore.getDocument({} as GetDocumentOptions);

updateDocument

Updates fields in the document referred to by the specified reference.

import { FirebaseFirestore } from '@capgo/capacitor-firebase-firestore';

await FirebaseFirestore.updateDocument({} as UpdateDocumentOptions);

Full Reference

Keep going from Using @capgo/capacitor-firebase-firestore

If you are using Using @capgo/capacitor-firebase-firestore to plan native plugin work, connect it with Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, Adding or Updating Plugins for the implementation detail in Adding or Updating Plugins, Ionic Enterprise Plugin Alternatives for the product workflow in Ionic Enterprise Plugin Alternatives, and Capgo Native Builds for the product workflow in Capgo Native Builds.

FAQ

Firebase Firestore plugin FAQ

How do I install the Firebase Firestore plugin in a Capacitor app?

Run "bun add @capgo/capacitor-firebase-firestore" (or "npm install @capgo/capacitor-firebase-firestore"), then run "bunx cap sync" so the iOS and Android projects pick up the native code. Import it from "@capgo/capacitor-firebase-firestore" in your app code.

Does @capgo/capacitor-firebase-firestore work with React, Vue and Angular?

Yes. Firebase Firestore is a Capacitor package, so it works with any web framework that runs inside Capacitor, including Ionic, React, Vue, Angular, Svelte and plain JavaScript.

Which Capacitor version does @capgo/capacitor-firebase-firestore support?

Capgo plugins follow Capacitor's major version: use the plugin major version that matches your Capacitor major version (for example plugin v8 with Capacitor 8). The compatibility table in the GitHub README lists the maintained versions.

Is @capgo/capacitor-firebase-firestore free and open source?

Yes. The source code is public on GitHub at https://github.com/Cap-go/capacitor-firebase/tree/main/packages/firestore and the package is free to install from npm. Bug reports and pull requests are welcome.

Can I update code that uses Firebase Firestore without an App Store review?

Installing or upgrading the plugin changes native code, so it needs a new store build. After that, JavaScript, HTML and CSS changes that call the plugin can ship instantly with Capgo live updates.

Ship Firebase Firestore changes without waiting for app review

Once the plugin is in your store build, Capgo live updates push your JavaScript, HTML and CSS changes to users in minutes.

Start with Capgo