@datocms/nuxt-module
v1.0.0
Published
Nuxt module for working with DatoCMS
Downloads
2
Keywords
Readme
DatoCMS Nuxt Module
A Nuxt.js module that helps you to work faster with DatoCMS with Nuxt.
Features
This module makes components and composables from vue-datocms easily available in Nuxt.
This module takes care of authentication for you: once the module is installed and properly configured, you're free to use components and composables without worrying about the token. Refer to vue-datocms
documentation for usage.
Setup
- Add
@datocms/nuxt-module
dependency to your project
npm install @datocms/nuxt-module # or yarn add @datocms/nuxt-module
- Add
@datocms/nuxt-module
to themodules
section ofnuxt.config.js
export default {
modules: [
// Simple usage
'@datocms/nuxt-module',
// With options
['@datocms/nuxt-module', { /* module options */ }]
]
}
Using top level options
export default {
modules: [
'@datocms/nuxt-module'
],
/* DatoCMS module options */
datocms: {
/* The token is mandatory: you find the token in the settings of your DatoCMS project */
datocmsReadOnlyToken: 'YOUR TOKEN',
}
}
Options
token
- Type:
String
- Default:
process.env.NUXT_ENV_DATOCMS_API_TOKEN
environment
- Type:
String
- Default:
process.env.NUXT_ENV_DATOCMS_ENVIRONMENT
endpoint
- Type:
String
- Default:
https://graphql.datocms.com
Development
- Run
npm run dev:prepare
to generate type stubs. - Use
npm run dev
to start playground in development mode.
License
Copyright (c) - DatoCMS