3

Firebase use this pattern for its database and auth and storage URL

auth: https://[PROJECT_ID]. firebaseapp.com
database: https://[PROJECT_ID].firebaseio.com
storage: https://[PROJECT_ID]. appspot.com

I need to map these URLs to my custom domain like this

auth: https://fbauth. [MY_CUSTOM_DOMAIN].com
database: https://fbdb.[MY_CUSTOM_DOMAIN].com
storage: https://fbstorage. [MY_CUSTOM_DOMAIN].com

It will help to improve my website SEO because all request will be served from my domain

I googled it and found this link Serving an API from Your Domain Name but I'm looking for a straight-forward solution.

Could you please first let me know if I'm doing the right thing And second, let me know how I should do this

Fakhruddin Abdi
  • 876
  • 2
  • 11
  • 25

1 Answers1

3

There is no way to serve the Firebase Realtime Database from your own domain, without writing your own wrapper around it. It has been tried before, but to my knowledge nobody ever finished it. Also see Firebase custom domain name for database

The same applies to Cloud Storage for Firebase. If you want to control the domain it is served from, you'll have to implement a proxy/wrapper. That probably defeats the purpose of why you use Cloud Storage to begin with.

You can use a custom domain for the email verification flow for Firebase Authentication. But as far as I know there is no way to set up your custom domain for other authentication operations. So here too, a wrapper/proxy would be your only option. Also see: Add custom domain to be used with firebase real time database (i.e. verify email links), and Custom authDomain in Firebase (where Michael's answer sounds promising).

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807