Contentstack Nuxt Module is based on Contentstack javascript sdk along with additional functionality.
npm install nuxt-module-amitContentstack Nuxt Module is based on Contentstack javascript sdk along with additional functionality.
- [x] Allow you to fetch content from multiple stacks
- [x] Make this.contentstack available globally
``bash`
npm i @nuxtjs/contentstack-module
`bash`
export default {
modules: [
contentstack
],
contentstack:{
stackConfig:[{
name: 'Name for the stack',
apiKey: 'stack_api_key',
deliveryToken: 'stack_delivery_token',
environment: 'publishing_environment',
region: 'stack_region',
customHost:'optional use only when custom region is required'
}]
}
}
`bash`
export default {
modules: [
contentstack
],
contentstack:{
stackConfig:[{
name: 'Name for the stack',
apiKey: 'stack_api_key',
deliveryToken: 'stack_delivery_token',
environment: 'publishing_environment',
region: 'stack_region',
apiHost: 'api host api for live preview',
appHost: 'app host for live edit',
managementToken: 'management token with readonly accesses',
livePreview: true,
liveEdit: false,
customHost:'optional use only when custom region is required'
}]
}
}
`bash`
export default {
modules: [
contentstack
],
contentstack:{
stackConfig:[{
name: 'Name for the stack',
apiKey: 'stack_api_key',
deliveryToken: 'stack_delivery_token',
environment: 'publishing_environment',
region: 'stack_region',
apiHost: 'api host api for live preview',
appHost: 'app host for live edit',
managementToken: 'management token with readonly accesses',
livePreview: true,
liveEdit: false,
customHost:'optional use only when custom region is required'
},{
name: 'Name for the stack',
apiKey: 'stack_api_key',
deliveryToken: 'stack_delivery_token',
environment: 'publishing_environment',
region: 'stack_region',
customHost:'optional use only when custom region is required'
}]
}
}
> _NOTE:_ If stackName field contains spaces special characters for example Starter/app expected output would be StarterApp. If no value is added in stackName field expected output would be Stack1.
> _NOTE:_ If you want to custom region stack with can add them using customHost example customHost:'cdn.contentstack.io'
> _NOTE:_ Live preview can only be applicable to one stack instance at a time.
Add the following script to your .vue file and use it in your template.
`bash``