Sorry, no results found for "".

Show examples in:
Javascript HTTP
Endpoint info
Available examples

Content Management API > Environment

List all environments

Returns

Returns an array of resource objects of type environment

Examples

1
import { buildClient } from "@datocms/cma-client-node";
2
3
async function run() {
4
const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });
5
6
const environments = await client.environments.list();
7
8
for (const environment of environments) {
9
// Check the 'Returned output' tab for the result ☝️
10
console.log(environment);
11
}
12
}
13
14
run();
1
{
2
id: "main",
3
meta: {
4
status: "ready",
5
created_at: "2020-04-21T07:57:11.124Z",
6
read_only_mode: true,
7
last_data_change_at: "2020-04-21T07:57:11.124Z",
8
primary: true,
9
forked_from: "main",
10
},
11
}