Firebase authentication
Demo flowChoose an authentication strategy
Update the auth
method in your config.
auth: {
method: 'firebase',
},
Create a Firestore database
Set the Firestore security rules to only allow authenticated access Watch
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if request.auth.uid != null;
}
}
}
Get your Firebase credentials
- Get API key .
- Update to your
.env
file.
VITE_FIREBASE_API_KEY=
VITE_FIREBASE_AUTH_DOMAIN=
VITE_FIREBASE_PROJECT_ID=
VITE_FIREBASE_STORAGE_BUCKET=
VITE_FIREBASE_MESSAGING_SENDER_ID=
VITE_FIREBASE_APPID=
You can find this configuration in your Firebase project settings:
