@@ -662,12 +662,25 @@ export async function resolveVariablesForEnvironment(runtimeEnvironment: Runtime
662662 runtimeEnvironment . id
663663 ) ;
664664
665+ const overridableTriggerVariables = await resolveOverridableTriggerVariables ( runtimeEnvironment ) ;
666+
665667 const builtInVariables =
666668 runtimeEnvironment . type === "DEVELOPMENT"
667669 ? await resolveBuiltInDevVariables ( runtimeEnvironment )
668670 : await resolveBuiltInProdVariables ( runtimeEnvironment ) ;
669671
670- return [ ...projectSecrets , ...builtInVariables ] ;
672+ return [ ...overridableTriggerVariables , ...projectSecrets , ...builtInVariables ] ;
673+ }
674+
675+ async function resolveOverridableTriggerVariables ( runtimeEnvironment : RuntimeEnvironment ) {
676+ let result : Array < EnvironmentVariable > = [
677+ {
678+ key : "TRIGGER_REALTIME_STREAM_VERSION" ,
679+ value : env . REALTIME_STREAM_VERSION ,
680+ } ,
681+ ] ;
682+
683+ return result ;
671684}
672685
673686async function resolveBuiltInDevVariables ( runtimeEnvironment : RuntimeEnvironment ) {
@@ -684,10 +697,6 @@ async function resolveBuiltInDevVariables(runtimeEnvironment: RuntimeEnvironment
684697 key : "TRIGGER_STREAM_URL" ,
685698 value : env . STREAM_ORIGIN ?? env . API_ORIGIN ?? env . APP_ORIGIN ,
686699 } ,
687- {
688- key : "TRIGGER_REALTIME_STREAM_VERSION" ,
689- value : env . REALTIME_STREAM_VERSION ,
690- } ,
691700 ] ;
692701
693702 if ( env . DEV_OTEL_BATCH_PROCESSING_ENABLED === "1" ) {
@@ -758,10 +767,6 @@ async function resolveBuiltInProdVariables(runtimeEnvironment: RuntimeEnvironmen
758767 key : "TRIGGER_ORG_ID" ,
759768 value : runtimeEnvironment . organizationId ,
760769 } ,
761- {
762- key : "TRIGGER_REALTIME_STREAM_VERSION" ,
763- value : env . REALTIME_STREAM_VERSION ,
764- } ,
765770 ] ;
766771
767772 if ( env . PROD_OTEL_BATCH_PROCESSING_ENABLED === "1" ) {
0 commit comments