publish / src /lib /env.server.ts
caustino's picture
Upload 104 files
a038238 verified
Raw History Blame Contribute Delete
477 Bytes
export function env(key: string): string | undefined {
const v = process.env[key]?.trim();
return v || undefined;
}
/**
* Workspace preview vs deployed app. The deployer writes GROK_PROJECT_ID on
* every publish; the sandbox preview never has it. Single source of truth for
* the split — gate audience, gate endpoints and connector-token semantics all
* key off this predicate.
*/
export function isWorkspacePreview(): boolean {
return !env("GROK_PROJECT_ID");
}