clerk / clerk-firebase-starter

Official guide on how to use Clerk.dev with Firebase

Home Page:https://fir-clerk.web.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clerk - Firebase example repo

This repo shows an example use case for how you can setup Firebase with Clerk as a custom authentication provider.

Open in VS Code

Premium Recipes App

The Premium Recipes App allows only authenticated users to add their favorite recipes on the site to be shared with all other logged in members.

The app is live at https://fir-clerk.web.app/. Check it out!

Under the hood

This example app uses:

Reading the /recipes collection is only possible for authenticated users based on Firebase rules.

Where the magic happens

The Clerk integration works by providing a custom authentication token to the Firebase signInWithCustomToken auth method. The only thing you need to do on the application level can be seen at the useRecipes file.

To get a better understanding of the integration, you can check out our documentation on the integration.

Running the starter

To run the example locally you need to:

  1. Sign up for a Clerk account at http://clerk.dev/.
  2. Turn on and configure the integration on your Clerk dashboard.
  3. Setup the required Clerk Frontend API variable from your Clerk project as shown at the example env file.
  4. Replace the Firebase configuration file with you own project settings file.
  5. Check the instructions on how to setup your Firebase project for a similar setup at the specific setup document.
  6. yarn to install the required dependencies.
  7. yarn dev and you are good to go.

Contact

If you have any specific use case or anything you would like to ask, please reach out!

About

Official guide on how to use Clerk.dev with Firebase

https://fir-clerk.web.app/


Languages

Language:TypeScript 98.9%Language:JavaScript 0.6%Language:Shell 0.4%