Skip to content

Twilio Environment Variables Validation on Backend Startup #1

Description

@harsharajkumar-273

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions