farsabbutt / firestore-utils-cli

Google firebase firestore utility cli to export collections data.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

๐Ÿ”ฅ firestore-utils-cli

Google firebase firestore utility cli to export collections data.

oclif

๐Ÿš€ Demo

firestore utils cli demo

๐Ÿ“œ Usage

  1. Install package by running npm install -g firestore-utils-cli
  2. Inside any folder create a firebase-credentials.json file
  3. Configure firebase credentials and firebase database URL in the file created in the last step. Your config should look like this:
{
  "firebaseCredentials": {
    "type": "service_account",
    "project_id": "YOUR_PROJECT_ID",
    "private_key_id": "YOUR_PRIVATE_KEY_ID",
    "private_key": "YOUR_PRIVATE_KEY",
    "client_email": "YOUR_CLIENT_EMAIL",
    "client_id": "YOUR_CLIENT_ID",
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://oauth2.googleapis.com/token",
    "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
    "client_x509_cert_url": "YOUR_CLIENT_x509_CERT_URL"
  },
  "firestoreDatabaseUrl": "YOUR_DATABASE_URL"
}
  1. Follow Google's documentation to get your service account credentials: Generate a private key file for your service account
  2. Execute firestore-utils export-data to have an interactive CLI menu to export your firestore collections
  3. Once exported successfully, the exported firebase collections will be listed under exports folder

โ— Important Notes

Please note that exporting firestore data means you will be performing reads on your firestore database, and you may get charged for it especially when you have a large amount of data in your collections!

About

Google firebase firestore utility cli to export collections data.

License:MIT License


Languages

Language:TypeScript 85.4%Language:JavaScript 13.5%Language:Batchfile 1.1%