DEV Community

loading...

Dynamic Links with Firebase (Alternative to URL shortener service)

khvmaths profile image hongvin Updated on ・2 min read

I recently has a new domain, yay! But, i always wanted to have my own URL shortener service, like hv.in. Upon searching at Namecheap, I gave up 😢.
P1

BUT, I won't stop there. I searched for free domain, such as .tk, still no luck.
P2

So, since I have my own domain, but I don't want my domain to be solely serve as URL shortener only. And, thankfully Firebase offer similar services. I simply create a new subdomain and then use that subdomain for my shortener service. Although it's not as good as bit.ly / goo.gl (those fancy yet short one), but it serve the purpose!

💡 If you are lucky to get one with a low price or you just don't mind about the price tag, you can use YOURLS to manage your URL shortener service.

Create a new domain/subdomain at your domain provider dashboard

In my case, Ionos.

1. Click Domains & SSL 2. Click your registered domain
3. Head over to Subdomains and click on Add subdomain 4. Give your subdomain a name

Once you have done this, you shall have something like below,
P2

Go to Firebase console and configure the subdomain

Please refer my previous post on how to do so. (Step 1 in the post)

You are almost there!

Use dynamic links in Firebase

Step 1, select Dynamic links in Firebase
P3
Step 2, key in your subdomain and follow the on-screen instruction.
P4
You shall arrive at this page if everything is right!
P5
It's done!

It might take several hours to be able to use dynamic links.

AND, YOU HAVE JUST SETUP A SO-CALLED 'URL Shortener Service'!

Create your first 'shortened link'

At dynamic link dashboard, click on New Dynamic Link
P6
Just follow all on-screen instruction.

🍷 That's all!

Buy Me A Coffee

Discussion (0)

pic
Editor guide