Show examples in:
    List all environments

    Returns

    Returns an array of environment resource objects.

    Examples

    Example code:
    import { buildClient } from '@datocms/cma-client-node';
    async function run() {
    const client = buildClient({ apiToken: '<YOUR_API_TOKEN>' });
    const environments = await client.environments.list();
    environments.forEach((environment) => {
    console.log(environment);
    });
    }
    run();
    Returned output:
    {
    id: 'main',
    meta: {
    status: 'ready',
    fork_completion_percentage: 95,
    read_only_mode: true,
    created_at: '2020-04-21T07:57:11.124Z',
    last_data_change_at: '2020-04-21T07:57:11.124Z',
    primary: true,
    forked_from: 'main'
    }
    }