(projectMembers)
Lists all members of a project.
import { Vercel } from "@simplesagar/vercel";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projectMembers.get({
idOrName: "prj_pavWOn1iLObbXLRiwVvzmPrTWyTf",
});
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { VercelCore } from "@simplesagar/vercel/core.js";
import { projectMembersGet } from "@simplesagar/vercel/funcs/projectMembersGet.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 projectMembersGet(vercel, {
idOrName: "prj_pavWOn1iLObbXLRiwVvzmPrTWyTf",
});
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 Object | Status Code | Content Type |
---|---|---|
models.SDKError | 4xx-5xx | / |
Adds a new member to the project.
import { Vercel } from "@simplesagar/vercel";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projectMembers.add("prj_pavWOn1iLObbXLRiwVvzmPrTWyTf");
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { VercelCore } from "@simplesagar/vercel/core.js";
import { projectMembersAdd } from "@simplesagar/vercel/funcs/projectMembersAdd.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 projectMembersAdd(vercel, "prj_pavWOn1iLObbXLRiwVvzmPrTWyTf");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
idOrName |
string | ✔️ | The ID or name of the Project. | [object Object] |
teamId |
string | ➖ | The Team identifier to perform the request on behalf of. | |
slug |
string | ➖ | The Team slug to perform the request on behalf of. | |
requestBody |
models.AddProjectMemberRequestBody | ➖ | N/A | |
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 Object | Status Code | Content Type |
---|---|---|
models.SDKError | 4xx-5xx | / |
Remove a member from a specific project
import { Vercel } from "@simplesagar/vercel";
const vercel = new Vercel({
bearerToken: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await vercel.projectMembers.remove("prj_pavWOn1iLObbXLRiwVvzmPrTWyTf", "ndlgr43fadlPyCtREAqxxdyFK");
// Handle the result
console.log(result)
}
run();
The standalone function version of this method:
import { VercelCore } from "@simplesagar/vercel/core.js";
import { projectMembersRemove } from "@simplesagar/vercel/funcs/projectMembersRemove.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 projectMembersRemove(vercel, "prj_pavWOn1iLObbXLRiwVvzmPrTWyTf", "ndlgr43fadlPyCtREAqxxdyFK");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result)
}
run();
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
idOrName |
string | ✔️ | The ID or name of the Project. | [object Object] |
uid |
string | ✔️ | The user ID of the member. | [object Object] |
teamId |
string | ➖ | The Team identifier to perform the request on behalf of. | |
slug |
string | ➖ | The Team slug to perform the request on behalf of. | |
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 Object | Status Code | Content Type |
---|---|---|
models.SDKError | 4xx-5xx | / |