Nuxt module for working with DatoCMS
[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![License][license-src]][license-href]
[npm-version-src]: https://img.shields.io/npm/v/@datocms/nuxt-module/latest.svg
[npm-version-href]: https://npmjs.com/package/@datocms/nuxt-module
[npm-downloads-src]: https://img.shields.io/npm/dt/@datocms/nuxt-module.svg
[npm-downloads-href]: https://npmjs.com/package/@datocms/nuxt-module
[license-src]: https://img.shields.io/npm/l/@datocms/nuxt-module.svg
[license-href]: https://npmjs.com/package/@datocms/nuxt-module
> A Nuxt.js module that helps you to work faster with DatoCMS with Nuxt.
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.
- useQuerySubscription
- useSiteSearch
1. Add @datocms/nuxt-module dependency to your project
``bash`
npm install @datocms/nuxt-module # or yarn add @datocms/nuxt-module
2. Add @datocms/nuxt-module to the modules section of nuxt.config.js
`js
export default {
modules: [
// Simple usage
'@datocms/nuxt-module',
// With options
['@datocms/nuxt-module', { / module options / }]
]
}
`
`js`
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',
}
}
- Type: Stringprocess.env.NUXT_ENV_DATOCMS_API_TOKEN
- Default:
- Type: Stringprocess.env.NUXT_ENV_DATOCMS_ENVIRONMENT
- Default:
- Type: Stringhttps://graphql.datocms.com
- Default:
- Run npm run dev:prepare to generate type stubs.npm run dev` to start playground in development mode.
- Use
Copyright (c) - DatoCMS