React Firebase
  • React Firebase
  • React Firebase Realtime Database
    • Setup
    • Usage
    • API
  • React Firebase Auth
    • Setup
    • Usage
    • API
  • React Firestore Database
    • Setup
    • Usage
    • API
  • Generate Firebase Data
    • Setup
    • Usage
  • Generate Firestore Data
    • Setup
    • Usage
  • Generate JSON Data
    • Setup
    • Usage
  • Guides
    • Build a React App with Firebase Auth and Realtime Database
      • Setup the development environment
      • Add React and React DOM
      • Add Firebase
      • Listen to auth
      • Adding Google and Anonymous Auth
      • Adding Data to your Realtime Database
      • Implementing the UI
      • Writing Data
      • Read Data
  • View Source
Powered by GitBook
On this page
  1. Generate Firestore Data

Setup

Setting up Firestore Data Generator with firebase-admin

PreviousGenerate Firestore DataNextUsage

Last updated 6 years ago

  1. First you need a Private Key from firebase for privileged environments, find out how to get it here: (or replace YOUR_PROJECT_NAME_HERE with your project name here : https://console.firebase.google.com/project/YOUR_PROJECT_NAME_HERE/settings/serviceaccounts/adminsdk

  2. Place that private key json file somewhere in your project.

  3. Take note of your databaseURL.

  4. Create a schema for the data you want to generate.

Installation

API

yarn add generate-firestore-data

CLI

# In your project :
yarn add -D generate-firestore-data
yarn generate-firestore-data <schemaFilePath> <credentialsFilePath>

# Or globally :
npm i -g generate-firestore-data
generate-firestore-data <schemaFilePath> <credentialsFilePath>

https://firebase.google.com/docs/admin/setup