Create
client.projects.members.create(stringprojectID, MemberCreateParams { role, userId } body, RequestOptionsoptions?): MemberCreateResponse { project }
POST/projects/{projectId}/members
Create
import Scenario from '@scenario-labs/sdk';
const client = new Scenario({
apiKey: process.env['SCENARIO_SDK_API_KEY'], // This is the default and can be omitted
apiSecret: process.env['SCENARIO_SDK_API_SECRET'], // This is the default and can be omitted
});
const member = await client.projects.members.create('projectId', {
role: 'role',
userId: 'userId',
});
console.log(member.project);{
"project": {
"id": "id",
"createdAt": "createdAt",
"keys": [
{
"id": "id",
"apiKeyId": "apiKeyId",
"apiKeyStatus": "active",
"createdAt": "createdAt",
"name": "name",
"role": "role",
"scope": "project",
"updatedAt": "updatedAt",
"authorId": "authorId",
"consumption": 0,
"lastUsedAt": "lastUsedAt",
"maxConsumption": 0,
"ownerId": "ownerId",
"projects": [
{
"projectId": "projectId",
"role": "role"
}
]
}
],
"name": "name",
"privacyMode": true,
"teamId": "teamId",
"updatedAt": "updatedAt",
"users": [
{
"id": "id",
"createdAt": "createdAt",
"email": "email",
"role": "role",
"updatedAt": "updatedAt",
"avatar": {
"assetId": "assetId",
"url": "url"
},
"consumption": 0,
"maxConsumption": 0
}
],
"avatar": {
"assetId": "assetId",
"url": "url"
},
"consumption": 0,
"description": "description",
"descriptionDate": "descriptionDate",
"disableIpDetection": true,
"maxConsumption": 0,
"qualityGateAutoDetect": true,
"settings": {
"homepage": {
"foo": "bar"
}
}
}
}Returns Examples
{
"project": {
"id": "id",
"createdAt": "createdAt",
"keys": [
{
"id": "id",
"apiKeyId": "apiKeyId",
"apiKeyStatus": "active",
"createdAt": "createdAt",
"name": "name",
"role": "role",
"scope": "project",
"updatedAt": "updatedAt",
"authorId": "authorId",
"consumption": 0,
"lastUsedAt": "lastUsedAt",
"maxConsumption": 0,
"ownerId": "ownerId",
"projects": [
{
"projectId": "projectId",
"role": "role"
}
]
}
],
"name": "name",
"privacyMode": true,
"teamId": "teamId",
"updatedAt": "updatedAt",
"users": [
{
"id": "id",
"createdAt": "createdAt",
"email": "email",
"role": "role",
"updatedAt": "updatedAt",
"avatar": {
"assetId": "assetId",
"url": "url"
},
"consumption": 0,
"maxConsumption": 0
}
],
"avatar": {
"assetId": "assetId",
"url": "url"
},
"consumption": 0,
"description": "description",
"descriptionDate": "descriptionDate",
"disableIpDetection": true,
"maxConsumption": 0,
"qualityGateAutoDetect": true,
"settings": {
"homepage": {
"foo": "bar"
}
}
}
}