Retrieve the environment variables of a project by id or name
GET
/__remote/api.vercel.com/v10/projects/{idOrName}/envRetrieve the environment variables for a given project by passing either the project
id or name in the URL.Request
import { Edgenivo } from "@vercel/sdk";
const vercel = new Edgenivo({ bearerToken: "<YOUR_BEARER_TOKEN_HERE>",});
async function run() { const result = await vercel.projects.filterProjectEnvs({ idOrName: "prj_XLKmu1DyR1eY7zq8UgeRKbA7yVLA", gitBranch: "feature-1", decrypt: "true", source: "vercel-cli:pull", customEnvironmentId: "env_123abc4567", customEnvironmentSlug: "my-custom-env", teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l", slug: "my-team-url-slug", });
console.log(result);}
run();Response
{ "comment": "string", "configurationId": "example_id", "contentHint": { "storeId": "example_id", "type": "redis-url" }, "createdAt": "123", "createdBy": "string", "customEnvironmentIds": [], "decrypted": "false", "edgeConfigId": "example_id", "edgeConfigTokenId": "example_id", "gitBranch": "string", "id": "icfg_1234567890", "key": "string", "securityIssues": [], "sunsetSecretId": "example_id", "system": "false", "target": [], "type": "encrypted", "updatedAt": "123", "updatedBy": "string", "value": "string", "visibility": "config"}AuthorizationbearerToken
Default authentication mechanism
If defined, the git branch of the environment variable to filter the results (must have target=preview)
200The list of environment variables for the given project
This is used to identify variables that have been migrated from type secret to sensitive.
400One of the provided values in the request query is invalid.
401The request is not authorized.
403You do not have permission to access this resource.
404Error
410Error