Description
The backend currently initializes the Twilio client using configurations in config.ts. If Twilio keys are missing or invalid, it prints a console warning and falls back to a local MockTwilio client.
Problem
While this is useful for offline developer environments, running the server in production mode without valid Twilio credentials will fail silently to send outgoing messages to citizens/responders.
Proposed Action Items
- Implement strict environment verification on server boot when
NODE_ENV=production.
- Throw a descriptive initialization error if
TWILIO_ACCOUNT_SID or TWILIO_AUTH_TOKEN is missing, preventing unsafe server starts.
Description
The backend currently initializes the Twilio client using configurations in
config.ts. If Twilio keys are missing or invalid, it prints a console warning and falls back to a localMockTwilioclient.Problem
While this is useful for offline developer environments, running the server in production mode without valid Twilio credentials will fail silently to send outgoing messages to citizens/responders.
Proposed Action Items
NODE_ENV=production.TWILIO_ACCOUNT_SIDorTWILIO_AUTH_TOKENis missing, preventing unsafe server starts.