I am using Firebase UI in my React App to allow users to login. Currently I have installed the firebaseui library using npm and then I use
var firebaseui = require('firebaseui')
at the top of my component and then I set up the ui with:
var ui = new firebaseui.auth.AuthUI(firebase.auth())
where firebase is defined and configured. All works ok.
if I try to use a cdn instead of the npm install I was expecting to just replace the first line with:
var firebaseui = window.firebaseui
This doesn't error until we get to the later statement initializing the ui variable which now errors with "firebase is not defined" - but the firebase variable hasn't been changed!
window.firebaseui.auth.AuthUI is indeed a function (seen when debugging) but why is firebase now not defined when it is when the firebaseui is set using require()?
thanks