Installation

Easily connect your Nuxt.js application to your content hosted on Prismic

Add @nuxtjs/prismic dependency to your project:

yarn add --dev @nuxtjs/prismic
npm install --save-dev @nuxtjs/prismic

Then, add @nuxtjs/prismic to the buildModules section of nuxt.config.js and configure your Prismic API endpoint:

nuxt.config.js
{
  buildModules: [
    '@nuxtjs/prismic'
  ],
  prismic: {
    endpoint: 'https://<REPOSITORY>.cdn.prismic.io/api/v2'
    /* see configuration for more */
  }
}

Finally, you're expected to provide a link resolver function at ~/app/prismic/link-resolver.js:

link-resolver.js
export default function(doc) {
  return '/'
}

More on link resolving on Prismic documentation.

Edit this page on GitHub Updated at Thu, Mar 4, 2021