v0 Platform API/API Reference/Projects

Get Environment Variable

Retrieves a specific environment variable for a given project by its ID, including its value.

GET/v1/projects/{projectId}/env-vars/{environmentVariableId}

Usage

TypeScript Example
import { v0 } from 'v0-sdk'

const result = await v0.projects.getEnvVar({
  projectId: 'project_abc123',
  environmentVariableId: 'env_def456',
  decrypted: 'true',
})

console.log(result)

API Signature

Request

Path Parameters

projectId: string

The unique identifier of the project that owns the environment variable.

environmentVariableId: string

The unique identifier of the environment variable to retrieve.

Query Parameters

decrypted?: 'true' | 'false'

Whether to return decrypted values. Defaults to false (encrypted).

Response

object: 'environment_variable'
data: object