Multiple Apps under one project ( new firebase )

10,097 views
Skip to first unread message

Evans Attafuah

unread,
May 19, 2016, 5:46:17 AM5/19/16
to Firebase Google Group
Hello,

I want to be able to manage development, beta and productions apps under one firebase project using the new interface but when I create 3 apps, they all have the same firebase reference and the google-service.json points to just one package name in android.

Need Help. 


Kato Richardson

unread,
May 19, 2016, 6:02:39 PM5/19/16
to Firebase Google Group
Hi Evans,

You're limited to one database per project. You'll need multiple projects to get multiple db instances.

☼, Kato


--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/CAGr72X9YpMEZY3dC6fT7XH8yJtNBUwSVeEoZbe5sPCmnwuSNuw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

Michael Bleigh

unread,
May 19, 2016, 6:05:59 PM5/19/16
to Firebase Google Group
Hey Evans,

We've thought a lot about this, and we think that project-level is the appropriate level for environment separation. For instance, you wouldn't want a service account intended to be used with your staging DB to accidentally wipe out your production DB. I'd encourage you to make multiple projects for your development and staging environments, and orient your development around that.

Cheers!
Michael

Vitali Kniazeu

unread,
Jun 28, 2016, 11:30:36 AM6/28/16
to Firebase Google Group
Thank you for the helpful answers!
What about multiple apps against one Firebase project?
I'm considering separating my admin app/tool from the main app, but it needs access to the same Firebase db instance.
I'm looking to host two entirely different Angular apps at admin.<domain>.<io> and just <domain>.<io>, but both will be using the same set of users and data.
I'd rather not expose the admin interface at <domain>.<io>/admin as it is likely to need its own security permissions (e.g. IP-based restrictions) and I prefer the root-based app.
Thank you in advance!

Michael Bleigh

unread,
Jun 28, 2016, 12:05:55 PM6/28/16
to Firebase Google Group
There's nothing keeping you from deploying two web apps to different domains while utilizing the same app initialization for both.

If you're deploying to Firebase Hosting, you should be aware that we presently do not support multiple sites on the same apex domain (so you can't host both admin.myapp.io and myapp.io on Firebase Hosting). We're looking to address this limitation, but don't have any timeframe on when.

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.

Vitali Kniazeu

unread,
Jun 28, 2016, 2:21:04 PM6/28/16
to Firebase Google Group
Thanks a bunch, Michael!
You've answered everything precisely. The limitation on the same apex domain is precisely what I've been struggling to overcome.
I will keep any eye on when it gets addressed, and meanwhile I will stick to using www.myapp.io (rather than myopp.io directly) vs. admin.myapp.io, so both are subdomains for now.

Michael Bleigh

unread,
Jun 28, 2016, 2:30:52 PM6/28/16
to Firebase Google Group
Unfortunately, even if you use two subdomains, Firebase Hosting won't allow both. We are well aware that this is a frustrating limitation and are working to address it.

Vitali Kniazeu

unread,
Jun 28, 2016, 3:38:01 PM6/28/16
to Firebase Google Group
Yeah, I realized it a few minutes after I posted my reply :-)
I any case, thank you for the very helpful info.
For now, I will structure my app according to this limitation or use my own hosting for the second app.
I do like the flexibility and ease of Firebase Hosting very much, so I'll find the best compromise :)

Michael Bleigh

unread,
Jun 28, 2016, 3:42:48 PM6/28/16
to Firebase Google Group
Thanks for being understanding, and best of luck with your app!

Michael Bleigh

unread,
Mar 15, 2017, 3:35:36 PM3/15/17
to Firebase Google Group
Quick update: Firebase Hosting now allows multiple subdomains of the same registered domain to be used across projects. So you could have project1-dev on dev.project1.com and www.project1.com on project1-prod.


On Tuesday, June 28, 2016 at 11:30:52 AM UTC-7, Michael Bleigh wrote:
Unfortunately, even if you use two subdomains, Firebase Hosting won't allow both. We are well aware that this is a frustrating limitation and are working to address it.

On Tue, Jun 28, 2016 at 11:21 AM Vitali Kniazeu <vit...@kniazeu.com> wrote:
Thanks a bunch, Michael!
You've answered everything precisely. The limitation on the same apex domain is precisely what I've been struggling to overcome.
I will keep any eye on when it gets addressed, and meanwhile I will stick to using www.myapp.io (rather than myopp.io directly) vs. admin.myapp.io, so both are subdomains for now.


On Tuesday, June 28, 2016 at 7:05:55 PM UTC+3, Michael Bleigh wrote:
There's nothing keeping you from deploying two web apps to different domains while utilizing the same app initialization for both.

If you're deploying to Firebase Hosting, you should be aware that we presently do not support multiple sites on the same apex domain (so you can't host both admin.myapp.io and myapp.io on Firebase Hosting). We're looking to address this limitation, but don't have any timeframe on when.
On Tue, Jun 28, 2016 at 8:30 AM Vitali Kniazeu <vit...@kniazeu.com> wrote:
Thank you for the helpful answers!
What about multiple apps against one Firebase project?
I'm considering separating my admin app/tool from the main app, but it needs access to the same Firebase db instance.
I'm looking to host two entirely different Angular apps at admin.<domain>.<io> and just <domain>.<io>, but both will be using the same set of users and data.
I'd rather not expose the admin interface at <domain>.<io>/admin as it is likely to need its own security permissions (e.g. IP-based restrictions) and I prefer the root-based app.
Thank you in advance!

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.

James Dufour

unread,
Mar 16, 2017, 11:03:48 AM3/16/17
to Firebase Google Group
How timely!

Is there documentation for this?

If I were to want to have two apps hosted, say admin.domain.com at /admin/index.html and app.domain.com on /app/index.html (and for bonus points, have proper routing for various urls app.domain/page/detail1)

Or should I just do connect two projects to one db?

Thanks for your time,

-j

Vitali Kniazeu

unread,
Mar 16, 2017, 11:04:11 AM3/16/17
to Firebase Google Group
Will dev.project1.com and project1.com work now as well, or a subdomain (www.project1.com) is required?

Kato Richardson

unread,
Mar 16, 2017, 12:51:54 PM3/16/17
to Firebase Google Group
Vitali,

You've always been able to point multiple subdomains to the same place as the apex. What has changed now is that you can specify some subdomains to point to a different Firebase project. It's fine to use the apex as one of those, too.

☼, Kato

To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

James Dufour

unread,
Mar 17, 2017, 2:42:04 PM3/17/17
to Firebase Google Group
Can I point multiple subdomains to subfolders?

Michael Bleigh

unread,
Mar 17, 2017, 2:48:55 PM3/17/17
to Firebase Google Group
Currently you must have a unique project directory for every project to which you want to deploy, and the public folder must be a subfolder (or the same folder) as the project folder.

Sivaram Siddhan Ilangovan

unread,
Mar 20, 2017, 10:28:33 AM3/20/17
to Firebase Google Group
Do you have any example of firebase.json file for achieving this?

James Dufour

unread,
Mar 21, 2017, 11:18:35 AM3/21/17
to Firebase Google Group
+1 Thanks in Advance

Paul Renshaw

unread,
Apr 13, 2018, 8:32:37 PM4/13/18
to Firebase Google Group
Hi,

Reading this, it doesn't seem a clear answer was given. Correct me if I'm wrong, but what I think you would do is:

Create two separate projects in the firebase console e.g. client-project and admin-project (resulting in firebase project domains client-project.firebaseapp.com and admin-project.firebaseapp.com respectively.)

Let's say your users, database etc. are all in client-project along with the hosted client application code that you configure to serve at yourdomain.com

Deploy your admin application code to hosting in admin-project BUT in your code use the project settings from client-project your initialisation script config, and add your admin project domain (admin-project.firebaseapp.com and/or admin.yourdomain.com) to the list of Authorized Domains in the Authentication > SIGN-IN METHOD section of your client project.

You won't have any users or data stored in the admin project, everything will come from the client project, but you will have the application code for the two subdomains hosted separately i.e. the admin code WILL NOT be within a subfolder hosted on the client domain e.g. client-project.firebaseapp.com/admin and you can deploy new code to the two application separately (if you deploy new code one project, you won't see those any deployments in the other).

BONUS

If you are using functions, you could deploy functions that do slightly different things on each subdomain, but with the same name e.g. if you have an https function on each subdomain that returns a list of users, and say the function of the client domain (yourdomain.com/users) only returns a list of user UIDs, but the function of the admin domain (admin.yourdomain.com/users) returns all users data (though since functions in the admin project would be initialised with the admin project config, the function would not fetch from the same project's database since there's nothing in there, it would have to make an api call to get data from the client project database, in which case you'd have to pass credentials for an admin user from the client project) ---- this is probably not a brilliant example, and I haven't tried this, but I assume this would be possible if necessary.

I repeat, please, correct me if I'm wrong since I saw this thread and replied without trying it first.
Reply all
Reply to author
Forward
0 new messages