diff --git a/firebase-config.js b/firebase-config.js index b941964..d0a5aa3 100644 --- a/firebase-config.js +++ b/firebase-config.js @@ -1,8 +1,8 @@ const _admin = require('firebase-admin') const {Storage} = require('@google-cloud/storage'); - -let init = false +let global = this.context().global +let init = (global.get('firebase') !== undefined) let s module.exports = function(RED) { @@ -28,7 +28,7 @@ module.exports = function(RED) { credential: credobj, databaseURL: this.dburl }); - let global = this.context().global + global.set('firebase', _admin) console.log('setting storage....') diff --git a/package.json b/package.json index b530156..682e733 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-red-contrib-firebase-admin", - "version": "1.1.6", + "version": "1.1.7", "description": "A node-red module that wraps the server-side admin SDK of firebase, firestore, et.c.", "main": "index.js", "scripts": {