Setup Firebase 🔥
Go to the Firebase Console:
Create a new project.
Go to
Firestore Database
and create a new database.Go to
Authentication
and enable theGoogle
,GitHub
andemail/password
sign-in methods. Go toAuthorized domains
and addlocalhost
and your production domain.Go to the
Project Settings
and scroll down toYour apps
and create a new web app. Copy the config values into your.env.local
file.Go to
Settings > Service Accounts
and generate a new private key. Save the JSON file and copy the values into your.env.local
file.
Your .env.local
file should look something like this:
ShipNow
1
2# Firebase Admin (for firestore) - Get the values from the service account JSON file
3FIREBASE_CLIENT_EMAIL=firebase-adminsdk-........iam.gserviceaccount.com
4FIREBASE_PRIVATE_KEY=-----BEGIN PRIVATE KEY-----\nMIIE.........Sw==\n-----END PRIVATE KEY-----\n
5
6# Firebase (for client-side)
7NEXT_PUBLIC_FIREBASE_API_KEY=AIzaS.......Dym4tqfo
8NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=s...6.firebaseapp.com
9NEXT_PUBLIC_FIREBASE_PROJECT_ID=s...6
10NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=s...6.appspot.com
11NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=1...2
12NEXT_PUBLIC_FIREBASE_APP_ID=1:10.........b295
Now you can sign-in with Google, or email/password!
Last updated Sat Aug 17 2024