Extra functionality for firebase-tools with support for emulators and auth through service account.
npm install firebase-tools-extra[![NPM version][npm-image]][npm-url]
[![Build Status][build-status-image]][build-status-url]
[![Coverage][coverage-image]][coverage-url]
[![License][license-image]][license-url]
[![Code Style][code-style-image]][code-style-url]
> Extra functionality for firebase-tools with support for emulators and auth through service account
``bash`
npm i --save-dev firebase-tools-extra
1. Generate a service account from within the settings section of the Firebase console
1. Save the service account to serviceAccount.json within your firebase project repo (or set SERVICE_ACCOUNT environment variable)serviceAccount.json
1. Make sure you add to your .gitignore so it is not committed as part of your changes - THIS IS EXTREMELY IMPORTANT
To use with emulators:
1. Do one of the following:
- Pass the --emulator flag along with your commandFIREBASE_DATABASE_EMULATOR_HOST
- Set and FIRESTORE_EMULATOR_HOST variabes to your environmentfirebase-extra database:get /users
1. Use firebase-tools-extra the same way you would firebase-tools:
firebase-tools-extra should be used the same way that firebase-tools is used - the API is as close to the same as possible:
`bash`
firebase-extra database:get --limit-to-last 10 /users
To run all unit tests, run yarn test. This starts emulators, runs tests, then shuts down emulators.
1. Start emulators: yarn emulateyarn test:watch
1. Run tests and watch for changes: (NOTE: if you don't want the file watcher on use yarn test:base)
firebase-tools does not have the following:
- support for emulators (feature request to add this to firebase-tools)
- full Firestore interactions including get, add, set, and update`
MIT
[npm-image]: https://img.shields.io/npm/v/firebase-tools-extra.svg?style=flat-square
[npm-url]: https://npmjs.org/package/firebase-tools-extra
[build-status-image]: https://img.shields.io/github/workflow/status/prescottprue/firebase-tools-extra/NPM%20Package%20Publish?style=flat-square&logo=github
[build-status-url]: https://github.com/prescottprue/firebase-tools-extra/actions
[coverage-image]: https://img.shields.io/codecov/c/gh/prescottprue/firebase-tools-extra?style=flat-square&logo=codecov
[coverage-url]: https://codecov.io/gh/prescottprue/firebase-tools-extra
[license-image]: https://img.shields.io/npm/l/firebase-tools-extra.svg?style=flat-square
[license-url]: https://github.com/prescottprue/firebase-tools-extra/blob/master/LICENSE
[code-style-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[code-style-url]: http://standardjs.com/