From ed6b4ef09d4444938eecee997c3344ac48487eb2 Mon Sep 17 00:00:00 2001 From: Bilal Godil Date: Mon, 1 Jun 2026 19:35:03 -0700 Subject: [PATCH] Use HEXCLAVE_ env var names in Next.js setup keys and fix default API URL check The Next.js .env generator still emitted legacy STACK_/NEXT_PUBLIC_STACK_ variable names after the Hexclave rebrand, inconsistent with the Vite block and TanStack setup prompt. Switch it to the HEXCLAVE_ prefix (the SDK dual-reads HEXCLAVE_* ?? STACK_*, so existing projects are unaffected). Also correct the default-API-URL comparison in both the Next.js and Vite generators to the actual current value (https://api.stack-auth.com), so the API URL override is omitted from generated env files when running against the default cloud. --- apps/dashboard/src/components/env-keys.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/dashboard/src/components/env-keys.tsx b/apps/dashboard/src/components/env-keys.tsx index bd861a94c..2a2c3931f 100644 --- a/apps/dashboard/src/components/env-keys.tsx +++ b/apps/dashboard/src/components/env-keys.tsx @@ -8,11 +8,11 @@ function getEnvFileContent(props: { superSecretAdminKey?: string, }) { const envFileContent = Object.entries({ - NEXT_PUBLIC_STACK_API_URL: getPublicEnvVar('NEXT_PUBLIC_STACK_API_URL') === "https://api.hexclave.com" ? undefined : getPublicEnvVar('NEXT_PUBLIC_STACK_API_URL'), - NEXT_PUBLIC_STACK_PROJECT_ID: props.projectId, - NEXT_PUBLIC_STACK_PUBLISHABLE_CLIENT_KEY: props.publishableClientKey, - STACK_SECRET_SERVER_KEY: props.secretServerKey, - STACK_SUPER_SECRET_ADMIN_KEY: props.superSecretAdminKey, + NEXT_PUBLIC_HEXCLAVE_API_URL: getPublicEnvVar('NEXT_PUBLIC_STACK_API_URL') === "https://api.stack-auth.com" ? undefined : getPublicEnvVar('NEXT_PUBLIC_STACK_API_URL'), + NEXT_PUBLIC_HEXCLAVE_PROJECT_ID: props.projectId, + NEXT_PUBLIC_HEXCLAVE_PUBLISHABLE_CLIENT_KEY: props.publishableClientKey, + HEXCLAVE_SECRET_SERVER_KEY: props.secretServerKey, + HEXCLAVE_SUPER_SECRET_ADMIN_KEY: props.superSecretAdminKey, }) .filter(([k, v]) => v) .map(([k, v]) => `${k}=${v}`) @@ -133,7 +133,7 @@ export function ViteEnvKeys(props: { secretServerKey?: string, }) { const envFileContent = Object.entries({ - VITE_HEXCLAVE_API_URL: getPublicEnvVar('NEXT_PUBLIC_STACK_API_URL') === "https://api.hexclave.com" ? undefined : getPublicEnvVar('NEXT_PUBLIC_STACK_API_URL'), + VITE_HEXCLAVE_API_URL: getPublicEnvVar('NEXT_PUBLIC_STACK_API_URL') === "https://api.stack-auth.com" ? undefined : getPublicEnvVar('NEXT_PUBLIC_STACK_API_URL'), VITE_HEXCLAVE_PROJECT_ID: props.projectId, HEXCLAVE_SECRET_SERVER_KEY: props.secretServerKey, })