Skip to content

Conversation

Sankalan47
Copy link

@Sankalan47 Sankalan47 commented Oct 11, 2025

#364 This PR adds a comprehensive environment variable validation system to prevent build/start failures caused by missing configuration.

The validation script checks for required Hyperswitch URLs, API keys, and asset endpoints before running commands like yarn start, yarn bundle, and yarn build:web. Sentry keys are intentionally excluded from validation as per project requirements.

Changes:

  • Add scripts/validateEnv.js validation script
  • Integrate validation into package.json scripts
  • Validate required environment variables
  • Provide clear error messages and actionable guidance

The validation exits with code 1 if any required variable is missing or empty, preventing builds with incomplete configuration.

Add strict validation to ensure all required environment variables are
present before building or starting the application. This prevents the
PaymentSheet from failing to open due to missing configuration.

The validation script checks for required Hyperswitch URLs, API keys,
and asset endpoints before running commands like yarn start, yarn bundle,
and yarn build:web. Sentry keys are intentionally excluded from validation
as per project requirements.

Changes:
- Add scripts/validateEnv.js validation script
- Integrate validation into package.json scripts (start, server, web,
  bundle, bundle:android, bundle:ios, build:web)
- Validate required environment variables
- Provide clear error messages and actionable guidance

Required variables validated:
- HYPERSWITCH_PRODUCTION_URL
- HYPERSWITCH_SANDBOX_URL
- HYPERSWITCH_INTEG_URL
- PROD_ASSETS_END_POINT
- SANDBOX_ASSETS_END_POINT
- INTEG_ASSETS_END_POINT
- HYPERSWITCH_LOGS_PATH

The validation exits with code 1 if any required variable is missing or
empty, preventing builds with incomplete configuration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant