Gathering detailed insights and metrics for next-auth-adapters-with-optional-chaining
Gathering detailed insights and metrics for next-auth-adapters-with-optional-chaining
Gathering detailed insights and metrics for next-auth-adapters-with-optional-chaining
Gathering detailed insights and metrics for next-auth-adapters-with-optional-chaining
npm install next-auth-adapters-with-optional-chaining
Typescript
Module System
Node Version
NPM Version
Cumulative downloads
Total Downloads
Last day
0%
2
Compared to previous day
Last week
0%
4
Compared to previous week
Last month
450%
11
Compared to previous month
Last year
-14.3%
78
Compared to previous year
21
Open Source. Full Stack. Own Your Data.
This is the Firebase Adapter for next-auth
. This package can only be used in conjunction with the primary next-auth
package. It is not a standalone package.
You can find more Firebase information in the docs at next-auth.js.org/adapters/firebase.
next-auth
and @next-auth/firebase-adapter
1npm install next-auth @next-auth/firebase-adapter
pages/api/[...nextauth].js
next-auth configuration object.1import NextAuth from "next-auth"
2import Providers from "next-auth/providers"
3import { FirebaseAdapter } from "@next-auth/firebase-adapter"
4
5import firebase from "firebase/app"
6import "firebase/firestore"
7
8const firestore = (
9 firebase.apps[0] ?? firebase.initializeApp(/* your config */)
10).firestore()
11
12// For more information on each option (and a full list of options) go to
13// https://next-auth.js.org/configuration/options
14export default NextAuth({
15 // https://next-auth.js.org/configuration/providers
16 providers: [
17 Providers.Google({
18 clientId: process.env.GOOGLE_ID,
19 clientSecret: process.env.GOOGLE_SECRET,
20 }),
21 ],
22 adapter: FirebaseAdapter(firestore),
23 ...
24})
When initializing the firestore adapter, you must pass in the firebase config object with the details from your project. More details on how to obtain that config object can be found here.
An example firebase config looks like this:
1const firebaseConfig = { 2 apiKey: "AIzaSyDOCAbC123dEf456GhI789jKl01-MnO", 3 authDomain: "myapp-project-123.firebaseapp.com", 4 databaseURL: "https://myapp-project-123.firebaseio.com", 5 projectId: "myapp-project-123", 6 storageBucket: "myapp-project-123.appspot.com", 7 messagingSenderId: "65211879809", 8 appId: "1:65211879909:web:3ae38ef1cdcb2e01fe5f0c", 9 measurementId: "G-8GSGZQ44ST", 10}
See firebase.google.com/docs/web/setup for more details.
From Firebase - Caution: We do not recommend manually modifying an app's Firebase config file or object. If you initialize an app with invalid or missing values for any of these required "Firebase options", then your end users may experience serious issues.
For open source projects, we generally do not recommend including the app's Firebase config file or object in source control because, in most cases, your users should create their own Firebase projects and point their apps to their own Firebase resources (via their own Firebase config file or object).
We're open to all community contributions! If you'd like to contribute in any way, please read our Contributing Guide.
ISC
No vulnerabilities found.
No security vulnerabilities found.