@@ -25,6 +25,7 @@ import {
2525 CONVEX_SELF_HOSTED_URL_VAR_NAME ,
2626 ENV_VAR_FILE_PATH ,
2727 bigBrainAPI ,
28+ processDeployKeyValue ,
2829} from "./utils/utils.js" ;
2930import * as dotenv from "dotenv" ;
3031
@@ -84,7 +85,8 @@ export async function initializeBigBrainAuth(
8485 } ) ;
8586 }
8687 const config = dotenv . parse ( existingFile ) ;
87- const deployKey = config [ CONVEX_DEPLOY_KEY_ENV_VAR_NAME ] ;
88+ const rawDeployKey = config [ CONVEX_DEPLOY_KEY_ENV_VAR_NAME ] ;
89+ const deployKey = await processDeployKeyValue ( ctx , rawDeployKey ) ;
8890 if ( deployKey !== undefined ) {
8991 const bigBrainAuth = getBigBrainAuth ( ctx , {
9092 previewDeployKey : isPreviewDeployKey ( deployKey ) ? deployKey : null ,
@@ -97,7 +99,8 @@ export async function initializeBigBrainAuth(
9799 }
98100 dotenv . config ( { path : ENV_VAR_FILE_PATH } ) ;
99101 dotenv . config ( ) ;
100- const deployKey = process . env [ CONVEX_DEPLOY_KEY_ENV_VAR_NAME ] ;
102+ const rawDeployKey = process . env [ CONVEX_DEPLOY_KEY_ENV_VAR_NAME ] ;
103+ const deployKey = await processDeployKeyValue ( ctx , rawDeployKey ) ;
101104 if ( deployKey !== undefined ) {
102105 const bigBrainAuth = getBigBrainAuth ( ctx , {
103106 previewDeployKey : isPreviewDeployKey ( deployKey ) ? deployKey : null ,
@@ -425,8 +428,12 @@ async function getDeploymentSelectionFromEnv(
425428) : Promise <
426429 { kind : "success" ; metadata : DeploymentSelection } | { kind : "unknown" }
427430> {
428- const deployKey = getEnv ( CONVEX_DEPLOY_KEY_ENV_VAR_NAME ) ;
429- if ( deployKey !== null ) {
431+ const rawDeployKey = getEnv ( CONVEX_DEPLOY_KEY_ENV_VAR_NAME ) ;
432+ const deployKey = await processDeployKeyValue (
433+ ctx ,
434+ rawDeployKey === null ? undefined : rawDeployKey ,
435+ ) ;
436+ if ( deployKey !== undefined ) {
430437 const deployKeyType = isPreviewDeployKey ( deployKey )
431438 ? "preview"
432439 : isProjectKey ( deployKey )
0 commit comments