Firebase

In this section you’ll find articles about Firebase in general that don’t rely on any framework or front-end technology. Things like new feature announcements, how to work with their dashboard, etc.

Do you need to hide your Firebase API keys for Ionic apps?
Tools used:
Backend: Firebase -- Version: Evergreen

About 3 or 4 times a month someone asks this questions, they are worried that since Ionic apps are client-side code (HTML, CSS, JS), someone can see their Firebase credentials and mess with their data. I understand why this is a concern. People want to keep their data private (ALL OF IT!). But there’s one thing we need to know about Firebase API keys. The fact that someone knows your apiKey is not a security risk alone (more on that later). ... Read More

How to handle multiple firebase projects from the same Ionic app
Tools used:
Backend: Firebase -- Version: Evergreen
Frontend: @ionic/angular -- Version: Evergreen

Do you have a separate environment for development, production, QA? Or do you test everything on the same Firebase application? For the longest time, I used one project for everything, but then, it got traction, couple hundred people started using it, and every time something crashed because of my testing I got several emails asking what was going on. At that point, I understood that I needed to separate things. ... Read More

How to send email verification link to your new users
Tools used:
Backend: Firebase -- Version: 7.14.4
Helper Library: @angular/fire -- Version: 6.0.0

Do you know how to prevent people from enter someone else’s email when signing up for your up? Firebase offers a handy tool for that called email verification link, and it’s a link you send to your users’ emails, they can click it, and it will verify their emails inside of Firebase Authentication. Then you can decide to only give access to verified users, or run a cleaning tool to remove non-verified users after set period of time. ... Read More

Learn how to install Firebase Extensions on your project
Tools used:
Backend: Firebase Cloud Functions -- Version: Evergreen

At the last Firebase Developer Summit, the Firebase team announced several new features. One that you’ll enjoy a lot is Firebase Extensions. Their website defines them as: Designed to increase productivity, Firebase Extensions provide extended functionality to your apps without the need to research, write, or debug code on your own. This just means that they noticed some functionality most of their users were implementing on their own and decided to implement it for you, so you can just click install and run it in your app. ... Read More

Learn how to reset, refresh, or terminate your users auth sessions
Tools used:
Backend: Firebase -- Version: 7.14.2
Helper Library: @angular/fire -- Version: 6.0.0

Can you control when a user logs out? What happens if you want to log out a user when they refresh the page or close the browser? Prefer the video version? Persistent authentication is excellent because our users can access our app without needing to log in every time they visit, but there are times when it’s not a good idea. Users can be careless and leave their sessions open in shared computers, or maybe they lost their phone, and someone found it, that someone can now access any web app our users had active. ... Read More

Use Firebase Cloud Functions to fetch an image and transform it to base64
Tools used:
Backend: Firebase Cloud Functions -- Version: 3.1.0

Have you done image manipulation on a server? That was one requirement I had a while back that I didn’t know how to solve at the moment. We were working with jsPDF to create report PDFs in one of our Ionic apps, but we had an issue, all of our images where stored online, and you can’t pass a url to jsPDF for images. It only takes base64, data URI, and I think the blob object. ... Read More