Problem
packages/jobs/trigger.config.ts validates TRIGGER_PROJECT_REF exists but never cross-checks that TRIGGER_SECRET_KEY belongs to the same deployment environment:
There is no assertion that a production deployment uses a tr_prod_* key (vs a tr_dev_* key). If a prod deployment accidentally uses a dev Trigger key:
- Jobs queue in the dev Trigger project
- Production events silently go unprocessed
- No error or alert fires
Fix
Add a startup assertion in trigger.config.ts:
const isProd = process.env.NODE_ENV === 'production';
const key = process.env.TRIGGER_SECRET_KEY ?? '';
if (isProd && !key.startsWith('tr_prod_')) {
throw new Error('Production deployment must use a tr_prod_* Trigger.dev key');
}
Severity
MEDIUM — misconfigured env causes silent job loss in production deployments.
Problem
packages/jobs/trigger.config.tsvalidatesTRIGGER_PROJECT_REFexists but never cross-checks thatTRIGGER_SECRET_KEYbelongs to the same deployment environment:There is no assertion that a production deployment uses a
tr_prod_*key (vs atr_dev_*key). If a prod deployment accidentally uses a dev Trigger key:Fix
Add a startup assertion in
trigger.config.ts:Severity
MEDIUM — misconfigured env causes silent job loss in production deployments.