Skip to content

fix: validate required env vars at startup (#332)#415

Merged
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
nomsoscript:codex/fix-required-env-startup-332
Jun 2, 2026
Merged

fix: validate required env vars at startup (#332)#415
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
nomsoscript:codex/fix-required-env-startup-332

Conversation

@nomsoscript
Copy link
Copy Markdown
Contributor

Closes #332

Changes

  • Added a centralized required environment variable list in src/config.required.ts.
  • Added startup validation that fails fast when any required env var is missing or empty.
  • Kept the error descriptive so it names the missing variable(s).
  • Updated config schema so empty PAYSTACK_PUBLIC_KEY is treated as unset, preserving its optional behavior.
  • Added tests for required env validation and the optional Paystack key behavior.
  • Aligned the startup optional-dependency warning tests with the actual optional config contract.

Testing

  • corepack pnpm test -- src/config.required.test.ts src/config.test.ts src/utils/startup.utils.test.ts
  • corepack pnpm build
  • corepack pnpm lint
  • prettier --check on the touched files

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 2, 2026

@nomsoscript Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Chucks1093 Chucks1093 merged commit 2656264 into accesslayerorg:main Jun 2, 2026
1 check passed
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.

Add startup validation for required environment variable presence

2 participants