Skip to content

datocms/nuxt-module

Repository files navigation

👉 Visit the DatoCMS homepage or see What is DatoCMS?


DatoCMS Nuxt Module

npm version npm downloads License

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.

Components:

Composables:

Setup

  1. Add @datocms/nuxt-module dependency to your project
npm install @datocms/nuxt-module # or yarn add @datocms/nuxt-module
  1. Add @datocms/nuxt-module to the modules section of nuxt.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

MIT License

Copyright (c) - DatoCMS


What is DatoCMS?

DatoCMS is the REST & GraphQL Headless CMS for the modern web.

Trusted by over 25,000 enterprise businesses, agency partners, and individuals across the world, DatoCMS users create online content at scale from a central hub and distribute it via API. We ❤️ our developers, content editors and marketers!

Quick links:

Our featured repos:

Or see all our public repos