Skip to content

Instantly share code, notes, and snippets.

Created September 1, 2020 09:53
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Fetch firebase remote config - a script for npm build
const admin = require("firebase-admin");
credential: admin.credential.cert(
process.env.NODE_ENV === 'production'
? require('./gcp.json')
: JSON.parse(process.env.FIREBASE_ADMIN_SDK)
databaseURL: process.env.FIREBASE_DATABASE_URL
.then(content =>
require('fs').writeFile('remoteConfig.json', JSON.stringify(content.parameterGroups), 'utf8',
(err) => err
? console.error(`failed to write remote conf: ${err}`)
: process.exit()
.catch(err => console.error(`failed fetching remote conf: ${err}`))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment