0

I want to let users sign-up for a sub-domain on my app's main domain. Unfortunately Firebase Hosting doesn't support wildcard subdomains (yet?), but I think I have an almost-automated way to do this.

I'll lay out my plan, but I'd really appreciate any feedback or improvements of how else I should solve this problem.

Steps:

  1. Gather a user's intention to create a subdomain
  2. Automate Firebase CLI to create another site, get DNS settings and add them into a Firestore doc (that I will then show the user)
  3. Upload a simple HTML page with <object> and their site app.website/username
  4. Cry because <objects> doesn't change the URL in the browser

Each user has a public profile on the main domain, like this: app.website/username, but I want to also host this page at username.app.website so they can point their domain (or subdomain) to their app.

Is there a way to do this efficiently?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Sam Chahine
  • 530
  • 1
  • 17
  • 52

1 Answers1

0

From the documentation on connecting to Firebase Hosting:

Each custom domain is limited to having 20 subdomains per apex domain, due to SSL certificate minting limits.

So you can't have more than 20 subdomains. As long as you stay within that limit, you approach could work. But it won't allow you to go over the limit.

Dharmaraj
  • 47,845
  • 8
  • 52
  • 84
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Ah, I understand. So would then a proper/scalable solution be to purchase a short-link domain, that can have unlimited subdomains, and can be create with a backend task. I can then show the user the DNS settings for their unique subdomain (hosted on another domain), but at least they can point to it from their own custom domain? – Sam Chahine Nov 12 '22 at 01:38