Mike Haslam
8 min readOct 27, 2021

--

How To Use Firebase Authentication With Gatsby

How to use firebase auth with gatsby

I want to share my journey of implementing Firebase Authentication on a Gatsby site. It’s so much more fun to use Firebase as an abstraction, versus writing all the authentication code from scratch.

For this journey, I choose to use email and password authentication. One of the great things about Firebase Authentication is there are many ways to authenticate your users. You can learn more here.

I have created a GitHub repository so you can follow along or use how you like.

Some assumptions I make are that you have Node and Gatsby CLI installed. You can learn about setting up your development environment here. I also assume you are familiar with Gatsby. Here are the docs if you're new to Gatsby. I also assume you understand React and the Context api.

Set Up A Firebase Project

First, we will head over to the Firebase console and get our project setup. You may need to set up an account if don’t have a google account already. What we will need is the web app to be added to the project so we can get the configuration object. Also, we need to set up email & password authentication and a Firestore database.

Here is a short video that shows the process. https://youtu.be/rJSAhovqXxY

Set Up A Gatsby…

--

--

Mike Haslam
Mike Haslam

Responses (3)