client.environments().create() adds an environment to a project.
const environment = await client.environments().create({
projectId: "<project-id>",
name: "QA",
slug: "qa",
});
const environment = await client.environments().create({
projectId: "<project-id>",
name: "QA",
slug: "qa",
position: 2,
});
{
"id": "f7b5d4e2-0a6c-4d9b-2e1f-8c3b4a5f6e7d",
"name": "QA",
"slug": "qa",
"position": 2,
"projectId": "5e8d7c6b-4a3f-4e2d-9c1b-0a9f8e7d6c5b",
"createdAt": "2026-12-02T10:47:55.318Z",
"updatedAt": "2026-12-02T10:47:55.318Z"
}
Create an environment
Add an environment to a project with the Node.js SDK.
const environment = await client.environments().create({
projectId: "<project-id>",
name: "QA",
slug: "qa",
});
const environment = await client.environments().create({
projectId: "<project-id>",
name: "QA",
slug: "qa",
position: 2,
});
{
"id": "f7b5d4e2-0a6c-4d9b-2e1f-8c3b4a5f6e7d",
"name": "QA",
"slug": "qa",
"position": 2,
"projectId": "5e8d7c6b-4a3f-4e2d-9c1b-0a9f8e7d6c5b",
"createdAt": "2026-12-02T10:47:55.318Z",
"updatedAt": "2026-12-02T10:47:55.318Z"
}
Was this page helpful?