Back to Content Management API

contentEnvironmentPrimary

Returns your store's primary content environment. Requests that don't name an environment use this one.

Returns

Request

import { PackClient } from '@pack/client'
const packClient = new PackClient({
  token: 'YOUR-PACK-TOKEN'
});

const query = `
  query ContentEnvironmentPrimary {
    contentEnvironmentPrimary {
      id
      name
      handle
      createdAt
    }
  }
`;

const variables = {};
const response = await packClient.fetch(query, { variables: variables });
console.log(response.data);

Response

{
    "data": {
        "contentEnvironmentPrimary": {
            "id": "YOUR-PRIMARY-ENVIRONMENT-ID",
            "name": "Production",
            "handle": "production",
            "createdAt": "2025-01-10T15:00:00.000Z"
        }
    }
}

Was this page helpful?