Choose your language:
    List all environments
    Returns
    Returns an array of environment objects.

    Examples

    Example code:
    const { SiteClient } = require('datocms-client');
    async function run() {
    const client = new SiteClient('YOUR-API-TOKEN');
    const environments = await client.environments.all();
    environments.forEach((environment) => {
    console.log(environment);
    });
    }
    run();
    Returned output:
    > node example.js
    {
    "id": "main",
    "meta": {
    "status": "ready",
    "created_at": "2020-04-21T07:57:11.124Z",
    "last_data_change_at": "2020-04-21T07:57:11.124Z",
    "primary": true,
    "forked_from": "main"
    }
    }