Vercel MCP
by zueai
- vercel-sdk-docs
- environment
# Environment
(*environment*)
## Overview
### Available Operations
* [postV1ProjectsIdOrNameCustomEnvironments](#postv1projectsidornamecustomenvironments) - Create a custom environment for the current project.
* [getV9ProjectsIdOrNameCustomEnvironments](#getv9projectsidornamecustomenvironments) - Retrieve custom environments
* [getV9ProjectsIdOrNameCustomEnvironmentsEnvironmentSlugOrId](#getv9projectsidornamecustomenvironmentsenvironmentslugorid) - Retrieve a custom environment
* [patchV9ProjectsIdOrNameCustomEnvironmentsEnvironmentSlugOrId](#patchv9projectsidornamecustomenvironmentsenvironmentslugorid) - Update a custom environment
* [deleteV9ProjectsIdOrNameCustomEnvironmentsEnvironmentSlugOrId](#deletev9projectsidornamecustomenvironmentsenvironmentslugorid) - Remove a custom environment
## postV1ProjectsIdOrNameCustomEnvironments
Creates a custom environment for the current project. Cannot be named 'Production' or 'Preview'.
### Example Usage
```typescript
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.environment.postV1ProjectsIdOrNameCustomEnvironments({
idOrName: "<value>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
// Handle the result
console.log(result);
}
run();
```
### Standalone function
The standalone function version of this method:
```typescript
import { VercelCore } from "@vercel/sdk/core.js";
import { environmentPostV1ProjectsIdOrNameCustomEnvironments } from "@vercel/sdk/funcs/environmentPostV1ProjectsIdOrNameCustomEnvironments.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await environmentPostV1ProjectsIdOrNameCustomEnvironments(vercel, {
idOrName: "<value>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request` | [models.PostV1ProjectsIdOrNameCustomEnvironmentsRequest](../../models/postv1projectsidornamecustomenvironmentsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
### Response
**Promise\<[models.PostV1ProjectsIdOrNameCustomEnvironmentsResponseBody](../../models/postv1projectsidornamecustomenvironmentsresponsebody.md)\>**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------------- | ---------------------------- | ---------------------------- |
| models.VercelBadRequestError | 400 | application/json |
| models.VercelForbiddenError | 401 | application/json |
| models.SDKError | 4XX, 5XX | \*/\* |
## getV9ProjectsIdOrNameCustomEnvironments
Retrieve custom environments for the project. Must not be named 'Production' or 'Preview'.
### Example Usage
```typescript
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.environment.getV9ProjectsIdOrNameCustomEnvironments({
idOrName: "<value>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
// Handle the result
console.log(result);
}
run();
```
### Standalone function
The standalone function version of this method:
```typescript
import { VercelCore } from "@vercel/sdk/core.js";
import { environmentGetV9ProjectsIdOrNameCustomEnvironments } from "@vercel/sdk/funcs/environmentGetV9ProjectsIdOrNameCustomEnvironments.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await environmentGetV9ProjectsIdOrNameCustomEnvironments(vercel, {
idOrName: "<value>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request` | [models.GetV9ProjectsIdOrNameCustomEnvironmentsRequest](../../models/getv9projectsidornamecustomenvironmentsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
### Response
**Promise\<[models.GetV9ProjectsIdOrNameCustomEnvironmentsResponseBody](../../models/getv9projectsidornamecustomenvironmentsresponsebody.md)\>**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------------- | ---------------------------- | ---------------------------- |
| models.VercelBadRequestError | 400 | application/json |
| models.VercelForbiddenError | 401 | application/json |
| models.SDKError | 4XX, 5XX | \*/\* |
## getV9ProjectsIdOrNameCustomEnvironmentsEnvironmentSlugOrId
Retrieve a custom environment for the project. Must not be named 'Production' or 'Preview'.
### Example Usage
```typescript
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.environment.getV9ProjectsIdOrNameCustomEnvironmentsEnvironmentSlugOrId({
idOrName: "<value>",
environmentSlugOrId: "<id>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
// Handle the result
console.log(result);
}
run();
```
### Standalone function
The standalone function version of this method:
```typescript
import { VercelCore } from "@vercel/sdk/core.js";
import { environmentGetV9ProjectsIdOrNameCustomEnvironmentsEnvironmentSlugOrId } from "@vercel/sdk/funcs/environmentGetV9ProjectsIdOrNameCustomEnvironmentsEnvironmentSlugOrId.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await environmentGetV9ProjectsIdOrNameCustomEnvironmentsEnvironmentSlugOrId(vercel, {
idOrName: "<value>",
environmentSlugOrId: "<id>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request` | [models.GetV9ProjectsIdOrNameCustomEnvironmentsEnvironmentSlugOrIdRequest](../../models/getv9projectsidornamecustomenvironmentsenvironmentslugoridrequest.md) | :heavy_check_mark: | The request object to use for the request. |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
### Response
**Promise\<[models.GetV9ProjectsIdOrNameCustomEnvironmentsEnvironmentSlugOrIdResponseBody](../../models/getv9projectsidornamecustomenvironmentsenvironmentslugoridresponsebody.md)\>**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------------- | ---------------------------- | ---------------------------- |
| models.VercelBadRequestError | 400 | application/json |
| models.VercelForbiddenError | 401 | application/json |
| models.VercelNotFoundError | 404 | application/json |
| models.SDKError | 4XX, 5XX | \*/\* |
## patchV9ProjectsIdOrNameCustomEnvironmentsEnvironmentSlugOrId
Update a custom environment for the project. Must not be named 'Production' or 'Preview'.
### Example Usage
```typescript
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.environment.patchV9ProjectsIdOrNameCustomEnvironmentsEnvironmentSlugOrId({
idOrName: "<value>",
environmentSlugOrId: "<id>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
// Handle the result
console.log(result);
}
run();
```
### Standalone function
The standalone function version of this method:
```typescript
import { VercelCore } from "@vercel/sdk/core.js";
import { environmentPatchV9ProjectsIdOrNameCustomEnvironmentsEnvironmentSlugOrId } from "@vercel/sdk/funcs/environmentPatchV9ProjectsIdOrNameCustomEnvironmentsEnvironmentSlugOrId.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await environmentPatchV9ProjectsIdOrNameCustomEnvironmentsEnvironmentSlugOrId(vercel, {
idOrName: "<value>",
environmentSlugOrId: "<id>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request` | [models.PatchV9ProjectsIdOrNameCustomEnvironmentsEnvironmentSlugOrIdRequest](../../models/patchv9projectsidornamecustomenvironmentsenvironmentslugoridrequest.md) | :heavy_check_mark: | The request object to use for the request. |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
### Response
**Promise\<[models.PatchV9ProjectsIdOrNameCustomEnvironmentsEnvironmentSlugOrIdResponseBody](../../models/patchv9projectsidornamecustomenvironmentsenvironmentslugoridresponsebody.md)\>**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------------- | ---------------------------- | ---------------------------- |
| models.VercelBadRequestError | 400 | application/json |
| models.VercelForbiddenError | 401 | application/json |
| models.SDKError | 4XX, 5XX | \*/\* |
## deleteV9ProjectsIdOrNameCustomEnvironmentsEnvironmentSlugOrId
Remove a custom environment for the project. Must not be named 'Production' or 'Preview'.
### Example Usage
```typescript
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.environment.deleteV9ProjectsIdOrNameCustomEnvironmentsEnvironmentSlugOrId({
idOrName: "<value>",
environmentSlugOrId: "<id>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
// Handle the result
console.log(result);
}
run();
```
### Standalone function
The standalone function version of this method:
```typescript
import { VercelCore } from "@vercel/sdk/core.js";
import { environmentDeleteV9ProjectsIdOrNameCustomEnvironmentsEnvironmentSlugOrId } from "@vercel/sdk/funcs/environmentDeleteV9ProjectsIdOrNameCustomEnvironmentsEnvironmentSlugOrId.js";
// Use `VercelCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const vercel = new VercelCore({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await environmentDeleteV9ProjectsIdOrNameCustomEnvironmentsEnvironmentSlugOrId(vercel, {
idOrName: "<value>",
environmentSlugOrId: "<id>",
teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
slug: "my-team-url-slug",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `request` | [models.DeleteV9ProjectsIdOrNameCustomEnvironmentsEnvironmentSlugOrIdRequest](../../models/deletev9projectsidornamecustomenvironmentsenvironmentslugoridrequest.md) | :heavy_check_mark: | The request object to use for the request. |
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
### Response
**Promise\<[models.DeleteV9ProjectsIdOrNameCustomEnvironmentsEnvironmentSlugOrIdResponseBody](../../models/deletev9projectsidornamecustomenvironmentsenvironmentslugoridresponsebody.md)\>**
### Errors
| Error Type | Status Code | Content Type |
| ---------------------------- | ---------------------------- | ---------------------------- |
| models.VercelBadRequestError | 400 | application/json |
| models.VercelForbiddenError | 401 | application/json |
| models.SDKError | 4XX, 5XX | \*/\* |