To fix the "Default Firebase app does not exist" or "Invalid token" errors, you must configure the Firebase Admin SDK.
- Go to Firebase Console: https://console.firebase.google.com/
- Select your project ("alysa-speak" or similar).
- Click the Gear Icon (Project Settings) > Service accounts.
- Click Generate new private key.
- This will download a JSON file.
Option A (Recommended):
- Rename the downloaded file to
serviceAccountKey.json. - Move it into the
alysa-engine/folder (next toapp.pyandrequirements.txt). - Restart your backend (
python app.pyorflask run). The app will auto-detect it.
Option B (Environment Variable):
- Save the file anywhere.
- In
alysa-engine/.env, set:FIREBASE_CREDENTIALS_PATH=/absolute/path/to/your/file.json
- Restart your backend.
Verification:
When you start the backend, you should see:
Firebase Admin SDK initialized with credentials from: ...
If you see "CRITICAL ERROR", read the error message to see what went wrong.