I want to use the same firebase project for multiple websites. How do I get this working on browser and cloud functions?
Browser
firebase.initializeApp({
apiKey: "***********************",
authDomain: "domain1.com",
databaseURL: "https://domain.firebaseio.com",
projectId: "domain",
storageBucket: "",
messagingSenderId: "-----------",
appId: "-------------"
});
If I change "domain1.com" to "domain2.com", will it work without issues? What happens to registered users in firebase? Will it be a combination of domain1.com and domain2.com?
Cloud functions
Will admin.database() return the domain.firebaseio.com RTDB irrespective of users logging into domain1.com or domain2.com? What happens to:
const tokenId = req.get('Authorization').split('Bearer ')[1];
admin.auth().verifyIdToken(idToken);
Thanks!