Skip to content

createVercelClient

createVercelClient(opts): object

Defined in: index.ts:45

Create a Vercel client with deployments, domains, env, projects, user and webhooks groups, all sharing one REST client built from opts.

VercelClientOptions

object

deployments: object

create: (input) => Promise<VercelDeployment>

Create a deployment directly from source files — no gitSource, no linked repo required. The non-git counterpart to trigger(), for a consumer with no repo to deploy from (a webhook receiver bundled and shipped as an npm package, for instance).

VercelCreateDeploymentInput

Promise<VercelDeployment>

get: (deploymentId) => Promise<VercelDeployment>

string

Promise<VercelDeployment>

list: (input) => Promise<VercelDeploymentPage>

One page of a project’s deployments, newest first, each with its meta.

VercelListDeploymentsInput

Promise<VercelDeploymentPage>

remove: (deploymentId) => Promise<VercelDeletedDeployment>

Deletes a deployment. One that is already gone is a ProviderApiError with status 404.

string

Promise<VercelDeletedDeployment>

trigger: (input) => Promise<VercelDeployment>

VercelTriggerDeploymentInput

Promise<VercelDeployment>

domains: object

add: (projectId, name) => Promise<VercelAddDomainResult>

string

string

Promise<VercelAddDomainResult>

config: (domain, projectIdOrName?) => Promise<VercelDomainConfig>

DNS routing status for domain — works regardless of whether the domain is already attached/verified on a project. projectIdOrName is optional per Vercel’s docs (“use this when the domain is not yet associated with a project”) but passed through when known to scope the recommendation to that project.

string

string

Promise<VercelDomainConfig>

list: (projectId) => Promise<VercelDomainsResponse>

string

Promise<VercelDomainsResponse>

env: object

list: (projectId) => Promise<VercelEnvVarsResponse>

string

Promise<VercelEnvVarsResponse>

set: (projectId, target, name, value) => Promise<VercelEnvVar>

string

VercelEnvTarget

string

string

Promise<VercelEnvVar>

projects: object

create: (input) => Promise<VercelProject>

VercelCreateProjectInput

Promise<VercelProject>

get: (nameOrId) => Promise<VercelProject>

string

Promise<VercelProject>

list: () => Promise<VercelProjectsResponse>

Promise<VercelProjectsResponse>

update: (projectId, input) => Promise<VercelProject>

string

VercelUpdateProjectInput

Promise<VercelProject>

user: object

createToken: (input) => Promise<VercelCreatedToken>

POST /v3/user/tokens: makes an account token and returns its value (bearerToken), once.

VercelCreateTokenInput

Promise<VercelCreatedToken>

currentToken: () => Promise<VercelTokenResponse>

Describes the token this client was made with: its name, kind, when it was made and when it expires. Never returns the token’s value.

Promise<VercelTokenResponse>

deleteToken: (tokenId) => Promise<VercelDeletedToken>

DELETE /v3/user/tokens/{tokenId}: invalidates a token. The id goes in the path through encodeURIComponent. Vercel reads the special id current as the token making the request, so a caller that must not delete its own token has to refuse that word itself. A token Vercel does not have is a 404 ProviderApiError.

string

Promise<VercelDeletedToken>

get: () => Promise<VercelUserResponse>

Promise<VercelUserResponse>

webhooks: object

create: (input) => Promise<VercelCreatedWebhook>

POST /v1/webhooks: makes a webhook and returns its secret, once.

VercelCreateWebhookInput

Promise<VercelCreatedWebhook>

list: () => Promise<VercelWebhook[]>

GET /v1/webhooks: the team’s webhooks (a bare array, no secrets).

Promise<VercelWebhook[]>