Been trying every approach I can think of for hours.
Basically I'm running an AWS Lambda function which does some work to my Firebase app in both a client and server role.
Being on Lambda, I need to be able to reverse the firebase.initializeApp(config) and firebase.initializeApp(config, 'server'). I've tried firebase.app('server').delete() but that doesn't seem to work.
Thanks in advance for any help.
To clarify, I can't just use the existing connection because the config may change.
Calls to initializeApp take an optional app name. If the app name is not specified, the name [DEFAULT] is used.
To uninitialize an app, you need to call delete on the app instance. The app instance is returned by the initializeApp call or can be obtained using the app function.
That is, you can initialize and uninitialize an app like this:
app = firebase.initializeApp(configuration);
app.delete();
Or like this:
firebase.initializeApp(configuration);
firebase.app('[DEFAULT]').delete();
Note that the delete function returns a promise that resolves when the app deletion is complete.
initializeApp returns the initialized app.
You can do :
const app = firebase.initializeApp(config);
//...
await app.delete();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With