Configuration
You can configure the Contentstack integration by adding the following properties to the cnts object in the middleware.config.js file:
module.exports = {
integrations: {
cnts: {
location: '@vsf-enterprise/contentstack-api/server',
configuration: {
key: 'CONTENT_DELIVERY_KEY',
token: 'CONTENT_DELIVERY_TOKEN',
env: 'CONTENT_ENV',
branch: 'CONTENT_BRANCH',
region: 'REGION_KEY' // (set 'EU' for European data center, remove for US)]
livePreview: {
managementToken: 'MANAGEMENT_TOKEN',
enable: true,
host: 'CONTENT_HOST',
},
fetchOptions: {
timeout: 'TIMEOUT',
retryLimit: 'RETRY_LIMIT',
retryDelay: 'RETRY_DELAY',
retryCondition: (error) => true,
}
}
}
}
};
Fetch Options
This feature provides options to manipulate request timeout. Available options:
timeout- The number of ms to timeout request.[default: 30000],retryLimit- The number of retries before failure.[default: 5],retryDelay- The number of ms to use for operation retries.[default: 300],retryCondition- A function to determine if the error can be retried.[default: retry on statuses 408, 429].
Live preview
This feature provides options to enable the Contentstack Live Preview. Available options:
managementToken- The management token to access the Contentstack Live Preview,enable- Enable or disable the Live Preview,host- The host of the Contentstack Live Preview.