Back to Content Management API

siteSettings

Returns the site settings in a draft or published state.

Arguments

  • Name
    version
    Type
    Version
    Description

    The state of the section you want to retrieve.

    • To get the latest content use CURRENT.
    • To get the latest published content use PUBLISHED
  • Name
    country
    Type
    CountryCode
    Description

    The country context for the query. Used with the @inContext directive.

  • Name
    language
    Type
    LanguageCode
    Description

    The language context for the query. Used with the @inContext directive.

Returns

Request

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

const query = `
query GetSiteSettings($version: Version) {
  siteSettings(version: $version) {
    id
    seo
  }
}
`
const response = await packClient.fetch(query);
console.log(response.data);

Response

{
    "data": {
        "siteSettings": {
            "id": "site-id",
            "seo": {
                "title": "SEO Title",
                "description": "SEO Description",
                "keywords": "SEO Keywords"
            }
        }
    }
}

Was this page helpful?