Skip to content

Instantly share code, notes, and snippets.

@PierBover
Created November 1, 2018 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PierBover/89ebb294fd0376a24c27bdbbf1f61966 to your computer and use it in GitHub Desktop.
Save PierBover/89ebb294fd0376a24c27bdbbf1f61966 to your computer and use it in GitHub Desktop.
Firebase cloud function admin init
const admin = require("firebase-admin");
const serviceAccount = require("./service-account.json");
if (admin.apps.length === 0) {
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: "https://XXXXX.firebaseio.com"
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment