sveltefire
sveltefire copied to clipboard
Ability to use multiple firebase apps
Hi Jeff, again a very nice package. Just wanted to know is there a way I can use multiple firebase projects inside the API. When I don't pass the firebase config then it will use the window.firebase instance. But wanted to know how I can use multiple ones.
related link https://firebase.google.com/docs/web/setup#multiple-projects
It uses Svelte's ContextAPI to manage projects. The children will use the parent project. This should work, but let me know if you run into any issues:
<script>
const defaultApp = firebase.initializeApp(configA);
const otherApp = firebase.initializeApp(configB, "other");
</script>
<FirebaseApp firebase={defaultApp}>
</FirebaseApp>
<FirebaseApp firebase={otherApp}>
</FirebaseApp>