(projectMembers)
- getProjectMembers - List project members
- addProjectMember - Adds a new member to a project.
- removeProjectMember - Remove a Project Member
Lists all members of a project.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projectMembers.getProjectMembers({
idOrName: "prj_pavWOn1iLObbXLRiwVvzmPrTWyTf",
limit: 20,
since: 1540095775951,
until: 1540095775951,
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectMembersGetProjectMembers } from "@vercel/sdk/funcs/projectMembersGetProjectMembers.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 projectMembersGetProjectMembers(vercel, {
idOrName: "prj_pavWOn1iLObbXLRiwVvzmPrTWyTf",
limit: 20,
since: 1540095775951,
until: 1540095775951,
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.GetProjectMembersRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | 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 | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.GetProjectMembersResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.SDKError | 4XX, 5XX | */* |
Adds a new member to the project.
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projectMembers.addProjectMember({
idOrName: "prj_pavWOn1iLObbXLRiwVvzmPrTWyTf",
requestBody: {
uid: "ndlgr43fadlPyCtREAqxxdyFK",
username: "example",
email: "[email protected]",
role: "ADMIN",
},
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectMembersAddProjectMember } from "@vercel/sdk/funcs/projectMembersAddProjectMember.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 projectMembersAddProjectMember(vercel, {
idOrName: "prj_pavWOn1iLObbXLRiwVvzmPrTWyTf",
requestBody: {
uid: "ndlgr43fadlPyCtREAqxxdyFK",
username: "example",
email: "[email protected]",
role: "ADMIN",
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.AddProjectMemberRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | 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 | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.AddProjectMemberResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.SDKError | 4XX, 5XX | */* |
Remove a member from a specific project
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projectMembers.removeProjectMember({
idOrName: "prj_pavWOn1iLObbXLRiwVvzmPrTWyTf",
uid: "ndlgr43fadlPyCtREAqxxdyFK",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { VercelCore } from "@vercel/sdk/core.js";
import { projectMembersRemoveProjectMember } from "@vercel/sdk/funcs/projectMembersRemoveProjectMember.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 projectMembersRemoveProjectMember(vercel, {
idOrName: "prj_pavWOn1iLObbXLRiwVvzmPrTWyTf",
uid: "ndlgr43fadlPyCtREAqxxdyFK",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.RemoveProjectMemberRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | 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 | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<models.RemoveProjectMemberResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
models.VercelBadRequestError | 400 | application/json |
models.VercelForbiddenError | 401 | application/json |
models.SDKError | 4XX, 5XX | */* |