Setup Firebase 🔥
Go to the Firebase Console:
Create a new project.
Go to
Firestore Databaseand create a new database.Go to
Authenticationand enable theGoogle,GitHubandemail/passwordsign-in methods. Go toAuthorized domainsand addlocalhostand your production domain.Go to the
Project Settingsand scroll down toYour appsand create a new web app. Copy the config values into your.env.localfile.Go to
Settings > Service Accountsand generate a new private key. Save the JSON file and copy the values into your.env.localfile.
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.........b295Now you can sign-in with Google, or email/password!
Last updated Sat Aug 17 2024