How-to

Vercel SDK

Learn how to use the Vercel SDK to interact with the Vercel REST API.
Table of Contents

The @vercel/sdk is a type-safe Typescript SDK that allows you to access the resources and methods of the Vercel REST API.

To view the methods for all endpoints, and explore code examples, see the reference documentation.

To download and install Vercel SDK, run the following command:

pnpm i @vercel/sdk

Vercel Access Tokens are required to authenticate and use the Vercel SDK.

Once you have created a token, you can use it to initialize the SDK as follows:

run.ts
import { Vercel } from '@vercel/sdk';
 
const vercel = new Vercel({
  bearerToken: '<YOUR_BEARER_TOKEN_HERE>',
});

Make sure that you create a token with the correct Vercel scope. If you face permission (403) errors when you are already sending a token, it can be one of the following problems:

  • The token you are using has expired. Check the expiry date of the token in the Vercel dashboard.
  • The token does not have access to the correct scope, either not the right team or it does not have account level access.
  • The resource or operation you are trying to use is not available for that team. For example, AccessGroups is an Enterprise only feature and you are using a token for a team on the pro plan.

Learn how to use Vercel SDK through the following categories of examples:

Last updated on December 9, 2024