Gatsby Firebase Simple Auth screenshot

Gatsby Firebase Simple Auth

Author Avatar Theme by Marcomelilli
Updated: 28 Feb 2024
61 Stars

Gatsby Starter with Firebase simple auth workflow and private routes

Categories

Overview

The Gatsby Firebase Authentication Starter is a Gatsby starter template that demonstrates how to implement an authentication workflow in Gatsby using Firebase as the authentication provider. The starter follows the best practices outlined in the official Gatsby documentation and utilizes the Gatsby Plugin Create Client Path to secure private routes.

Features

  • Firebase authentication integration
  • Whitelisting of client-only routes
  • Redirects to login page for unauthorized users
  • Display of private content for logged-in users

Installation

To use the Gatsby Firebase Authentication Starter, follow these steps:

  1. Copy and rename the .env.sample file to .env.development and .env.production in your project’s root directory.
  2. Update the environment variables in these files with your Firebase configuration.
  3. Create a Firebase project to obtain the necessary environment variables.
  4. Prefix environment variables that need to be accessible in the browser with GATSBY_.

Summary

The Gatsby Firebase Authentication Starter provides a convenient starting point for building a Gatsby website with user authentication. It leverages Firebase for authentication and implements client-only routes for secure access to private content. Whether you want to report bugs, improve the documentation, or contribute new features, the Gatsby Firebase Authentication Starter welcomes all contributions.