Environment Variables
Environment variables are exposed to the project’s build and runtime. Each variable is managed by key at its own URL.
GET /api/v1/projects/{id}/env-varsReturns { env_vars } — an array of { key, value }. Values are returned in full; a team API key already has full access to the project, so keep it server-side.
await client.env.list(projectId)Set (create or update)
Section titled “Set (create or update)”PUT /api/v1/projects/{id}/env-vars/{key}Body: value. Creates the variable if it doesn’t exist, updates it otherwise. Returns { key }.
curl -X PUT "https://www.frontend.co/api/v1/projects/$ID/env-vars/NEXT_PUBLIC_API_URL" \ -H "Authorization: Bearer $FRONTEND_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "value": "https://api.example.com" }'await client.env.set(projectId, 'NEXT_PUBLIC_API_URL', 'https://api.example.com')Delete
Section titled “Delete”DELETE /api/v1/projects/{id}/env-vars/{key}Returns { deleted }.
await client.env.delete(projectId, 'NEXT_PUBLIC_API_URL')