User

August 5, 2026 ยท View on GitHub

Overview

Available Operations

listUserEvents

Retrieves a list of "events" generated by the User on Vercel. Events are generated when the User performs a particular action, such as logging in, creating a deployment, and joining a Team (just to name a few). When the teamId parameter is supplied, then the events that are returned will be in relation to the Team that was specified.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.user.listUserEvents({
    limit: 20,
    since: "2019-12-08T10:00:38.976Z",
    until: "2019-12-09T23:00:38.976Z",
    types: "login,team-member-join,domain-buy",
    userId: "aeIInYVk59zbFF2SxfyxxmuO",
    principalId: "aeIInYVk59zbFF2SxfyxxmuO",
    projectIds: "aeIInYVk59zbFF2SxfyxxmuO",
    entityId: "scl_123",
    withPayload: "true",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { userListUserEvents } from "@vercel/sdk/funcs/userListUserEvents.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 userListUserEvents(vercel, {
    limit: 20,
    since: "2019-12-08T10:00:38.976Z",
    until: "2019-12-09T23:00:38.976Z",
    types: "login,team-member-join,domain-buy",
    userId: "aeIInYVk59zbFF2SxfyxxmuO",
    principalId: "aeIInYVk59zbFF2SxfyxxmuO",
    projectIds: "aeIInYVk59zbFF2SxfyxxmuO",
    entityId: "scl_123",
    withPayload: "true",
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("userListUserEvents failed:", res.error);
  }
}

run();

Parameters

ParameterTypeRequiredDescription
requestmodels.ListUserEventsRequest:heavy_check_mark:The request object to use for the request.
optionsRequestOptions:heavy_minus_sign:Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit: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.retriesRetryConfig:heavy_minus_sign:Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.ListUserEventsResponseBody>

Errors

Error TypeStatus CodeContent Type
models.SDKError4XX, 5XX*/*

listEventTypes

Returns the list of user-facing event types with descriptions.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.user.listEventTypes({
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { userListEventTypes } from "@vercel/sdk/funcs/userListEventTypes.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 userListEventTypes(vercel, {
    teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l",
    slug: "my-team-url-slug",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("userListEventTypes failed:", res.error);
  }
}

run();

Parameters

ParameterTypeRequiredDescription
requestmodels.ListEventTypesRequest:heavy_check_mark:The request object to use for the request.
optionsRequestOptions:heavy_minus_sign:Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit: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.retriesRetryConfig:heavy_minus_sign:Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.ListEventTypesResponse>

Errors

Error TypeStatus CodeContent Type
models.SDKError4XX, 5XX*/*

getAuthUser

Retrieves information related to the currently authenticated User.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.user.getAuthUser();

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { userGetAuthUser } from "@vercel/sdk/funcs/userGetAuthUser.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 userGetAuthUser(vercel);
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("userGetAuthUser failed:", res.error);
  }
}

run();

Parameters

ParameterTypeRequiredDescription
optionsRequestOptions:heavy_minus_sign:Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit: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.retriesRetryConfig:heavy_minus_sign:Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.GetAuthUserResponseBody>

Errors

Error TypeStatus CodeContent Type
models.SDKError4XX, 5XX*/*

requestDelete

Initiates the deletion process for the currently authenticated User, by sending a deletion confirmation email. The email contains a link that the user needs to visit in order to proceed with the deletion process.

Example Usage

import { Vercel } from "@vercel/sdk";

const vercel = new Vercel({
  bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await vercel.user.requestDelete({});

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { VercelCore } from "@vercel/sdk/core.js";
import { userRequestDelete } from "@vercel/sdk/funcs/userRequestDelete.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 userRequestDelete(vercel, {});
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("userRequestDelete failed:", res.error);
  }
}

run();

Parameters

ParameterTypeRequiredDescription
requestmodels.RequestDeleteRequestBody:heavy_check_mark:The request object to use for the request.
optionsRequestOptions:heavy_minus_sign:Used to set various options for making HTTP requests.
options.fetchOptionsRequestInit: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.retriesRetryConfig:heavy_minus_sign:Enables retrying HTTP requests under certain failure conditions.

Response

Promise<models.RequestDeleteResponseBody>

Errors

Error TypeStatus CodeContent Type
models.SDKError4XX, 5XX*/*