Simple Firebase authentication for all Next.js rendering strategies. This package makes it simple to get the authenticated Firebase user and ID token during both client-side and server-side rendering (SSR). We treat the Firebase JS SDK as the source of truth for auth status. When the user signs in, we call an endpoint to generate a refresh token and store the user info, ID token, and refresh token in cookies. Future requests to SSR pages receive the user info and ID token from cookies, refreshing the ID token as needed. When the user logs out, we unset the cookies. This package will likely be helpful if you're using Firebase authentication and expect to use server-side rendering—especially if you need access to Firebase ID tokens on the server side. If your app only uses static pages or doesn't need the Firebase user for SSR, use the Firebase JS SDK directly to load the user on the client side.

Features

  • Support for all Next.js rendering strategies
  • Signed, secure, HTTP-only cookies by default
  • Server-side access to the user's Firebase ID token
  • Built-in cookie management
  • Built-in support for redirecting based on the user's auth status
  • We treat the Firebase JS SDK as the source of truth for auth status

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow next-firebase-auth

next-firebase-auth Web Site

You Might Also Like
Our Free Plans just got better! | Auth0 by Okta Icon
Our Free Plans just got better! | Auth0 by Okta

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your secuirty. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of next-firebase-auth!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript Software Development Software, JavaScript Cloud Services Software

Registered

2022-11-03