> ## Documentation Index
> Fetch the complete documentation index at: https://sferadev.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# vercel-api-js

> Type-safe Vercel API client

A type-safe API client for the [Vercel Platform API](https://vercel.com/docs/rest-api), auto-generated from the official OpenAPI specification with full TypeScript support.

## Features

* **Type-Safe** - Full TypeScript support with auto-generated types from OpenAPI spec
* **Zod Schemas** - Runtime validation with Zod schemas for all API types
* **Auto-Updated** - Daily regeneration from upstream OpenAPI specs

## Installation

<CodeGroup>
  ```bash pnpm theme={null}
  pnpm add vercel-api-js
  ```

  ```bash npm theme={null}
  npm install vercel-api-js
  ```

  ```bash yarn theme={null}
  yarn add vercel-api-js
  ```
</CodeGroup>

## Usage

### Basic Usage

```typescript theme={null}
import { createClient } from "vercel-api-js";

const client = createClient({
  baseUrl: "https://api.vercel.com",
  headers: {
    Authorization: `Bearer ${process.env.VERCEL_TOKEN}`,
  },
});

// List all projects
const projects = await client.getProjects();

// Get a specific project
const project = await client.getProject({ idOrName: "my-project" });

// Create a new deployment
const deployment = await client.createDeployment({
  name: "my-project",
  target: "production",
});
```

### With Fetchers API

```typescript theme={null}
import { Fetchers } from "vercel-api-js";

// Use individual fetchers for specific endpoints
const projects = await Fetchers.getProjects({
  config: {
    headers: { Authorization: `Bearer ${token}` },
  },
});
```

### Type Exports

```typescript theme={null}
import type { Types } from "vercel-api-js";

// Use TypeScript types
type Project = Types.GetProjectResponseBody;
type Deployment = Types.CreateDeploymentResponseBody;
```

### Zod Schemas

```typescript theme={null}
import { Schemas } from "vercel-api-js";

// Validate API responses
const projectSchema = Schemas.getProjectResponseBody;
const validated = projectSchema.parse(response);
```

## API Reference

The client exposes all Vercel API endpoints including:

* **Projects** - Create, list, update, and delete projects
* **Deployments** - Manage deployments and rollbacks
* **Domains** - Configure custom domains
* **Environment Variables** - Manage env vars across environments
* **Teams** - Team and member management
* **Edge Config** - Edge configuration management
* **And more...**

For the complete API reference, see the [Vercel REST API documentation](https://vercel.com/docs/rest-api).
