@flarelog/sdk / detectVercelEnv
Function: detectVercelEnv()
detectVercelEnv(): {
isVercel:true;environment:string;region:string;url:string;commitSha:string;commitRef:string;projectId:string;deploymentId:string; } |null
Defined in: frameworks/vercel.ts:302
Detect Vercel-specific environment information.
Reads the standard VERCEL_* environment variables set automatically by the Vercel platform and returns them as a structured object. Returns null when not running on Vercel.
This is useful for enriching log metadata with deployment context:
VERCEL— always"1"on VercelVERCEL_ENV—"production"|"preview"|"development"VERCEL_REGION— deployment region (e.g."iad1")VERCEL_URL— auto-generated deployment URLVERCEL_GIT_COMMIT_SHA— git commit SHAVERCEL_GIT_COMMIT_REF— git branch nameVERCEL_PROJECT_ID— Vercel project identifierVERCEL_DEPLOYMENT_ID— unique deployment identifier
Returns
{ isVercel: true; environment: string; region: string; url: string; commitSha: string; commitRef: string; projectId: string; deploymentId: string; } | null