ScamGuard now uses Firebase Cloud Messaging (FCM) for SMS OTP instead of deprecated AWS Pinpoint.
- Firebase Project (free tier supports SMS)
- Firebase Authentication enabled
- Phone number verification enabled
# Go to Firebase Console
https://console.firebase.google.com/
# Create new project or use existing one
# Enable Google Analytics (optional but recommended)- Go to Authentication → Sign-in method
- Enable Phone provider
- Add phone numbers to test list (for development)
- Add your test phone numbers (e.g., +14388313122)
- Go to Project Settings → Service Accounts
- Copy the API Key from the Web API key section
- Or go to Project Settings → General → scroll to "Your apps"
- Select Web app → copy API Key from Firebase config
For Lambda/Production:
export FIREBASE_API_KEY="AIzaSy..." # Your Firebase API Key
export FIREBASE_PROJECT_ID="scamguard-12345" # Your Firebase Project IDFor Local Development (.env):
FIREBASE_API_KEY=AIzaSy...
FIREBASE_PROJECT_ID=scamguard-12345
In CDK stack or AWS Console:
Environment Variables:
FIREBASE_API_KEY: <your-api-key>
FIREBASE_PROJECT_ID: <your-project-id>
Local Test:
curl -X POST http://localhost:3001/api/v1/auth/request-sms-otp \
-H "Content-Type: application/json" \
-d '{"phone":"+14388313122"}'Production Test:
curl -X POST https://your-api.com/api/v1/auth/request-sms-otp \
-H "Content-Type: application/json" \
-d '{"phone":"+14388313122"}'The SMS sent to users will be:
ScamGuard - Votre code de vérification: 123456 (valide 10 minutes)
- Firebase SMS: ~$0.10 per message (varies by region)
- Free tier: 300 SMS/month
- See: https://firebase.google.com/pricing
node /Users/echetoui/scamguard-mvp/mock-server.js
# OTP logged to console - check server logs- Add your phone number to Firebase test list
- Request OTP → SMS arrives in seconds
- Enter code to verify
- Check environment variables are loaded
- Verify key in Firebase Console
- Ensure phone is in E.164 format: +1-514-831-3122
- For dev: add phone to test list in Firebase Console
- Check Firebase project has billing enabled
- User must complete phone verification in Firebase
- SMS code must match what Firebase generated
- ✅ Same OTP length (6 digits)
- ✅ Same expiration (10 minutes)
- ✅ Same rate limiting & brute force protection
- ✅ Same audit logging
- Firebase SMS: https://firebase.google.com/docs/auth/web/phone-auth
- Firebase API: https://firebase.google.com/docs/reference/rest/auth
- Phone authentication: https://firebase.google.com/docs/auth/web/start#set_up_sign-in_with_phone