Options

To set configurations for Cloudinary image transformer, we use inner options section of the gridsome-plugin-cloudinary in gridsome.config.js.

The list of available options are shown as below

cloudName - Required

  • Type: String
  • required

The cloud name associated with your Cloudinary account. It is used to configure and enable Cloudinary features such as generating delivery asset URL.

/* gridsome.config.js */

export default {
  plugins: [
    {
      use: 'gridsome-plugin-cloudinary',
      options: {
        cloudName: 'your-cloud-name'
      }
    },
  ]
}

Cloud name presents in every delivered URL from Cloudinary, hence it's important to have it configured correctly.

You can find your cloud name details in Dashboard page, or in Account Settings page in Cloudinary console

apiKey - Required

  • Type: String
  • required

The API Key associated with your Cloudinary account. It is used together with apiSecret to query images and videos from your Cloudinary account to GraphQL Data Layer.

/* gridsome.config.js */

export default {
  plugins: [
    {
      use: 'gridsome-plugin-cloudinary',
      options: {
        apiKey: 'your-api-key'
      }
    },
  ]
}

You can find your API Key in your Cloudinary Dashboard page, or in Settings/Security page in Cloudinary console

How to find apiKey in Cloudinary Console

Warning These private keys should be kept as environment variables in .env.

apiSecret - Required

  • Type: String
  • required

The API Secret Key associated with your Cloudinary account. It is used together with apiKey to query images and videos from your Cloudinary account to GraphQL Data Layer.

/* gridsome.config.js */

export default {
  plugins: [
    {
      use: 'gridsome-plugin-cloudinary',
      options: {
        apiSecret: 'your-api-secret-key'
      }
    }
  ]
}

You can find your API Secret Key in your Cloudinary Dashboard page, or in Settings/Security page in Cloudinary console.

How to find apiSecret in Cloudinary Console

Warning These private keys should be kept as environment variables in .env.

secure

  • Type: Boolean
  • Default: true

Force secure HTTPS delivery urls for all assets (images + videos) generated by Cloudinary, even if they are embedded in HTTP originally.

Disable this flag to have all delivery urls built with HTTP protocol instead.

/* gridsome.config.js */

export default {
  plugins: [
    {
      use: 'gridsome-plugin-cloudinary',
      options: {
        secure: false
      }
    },
  ]
}

secureDistribution

  • Type: String
  • Relevant only when secure is true

Set custom domain name for building secure HTTPS urls.

/* gridsome.config.js */

export default {
  plugins: [
    {
      use: 'gridsome-plugin-cloudinary',
      options: {
        secureDistribution: 'your-custome-domain-name'
      }
    },
  ]
}

Only relevant if you are Advanced plan Cloudinary user with private CDN distribution and custom CNAME set. You can see more details here

cname

  • Type: String
  • Use only when secure is false

Set custom domain name for building non-secure HTTP urls.

/* gridsome.config.js */

export default {
  plugins: [
    {
      use: 'gridsome-plugin-cloudinary',
      options: {
        cname: 'your-custome-domain-name'
      }
    },
  ]
}

Only relevant if you are Advanced plan Cloudinary user with private CDN distribution and custom CNAME set. You can see more details here

privateCdn

  • Type: Boolean
  • Default: false

Set to true if you'd like to use private CDN distribution.

/* gridsome.config.js */

export default {
  plugins: [
    {
      use: 'gridsome-plugin-cloudinary',
      options: {
        privateCdn: true
      }
    },
  ]
}

Only relevant for Advanced plan Cloudinary users. You can see more details here