Skip to content

Getting Started

Prerequisites

Installation

Setup

sh
$ npm add -D nuxt-wp
sh
$ pnpm add -D nuxt-wp
sh
$ yarn add -D nuxt-wp
sh
$ bun add -D nuxt-wp
ts
export default defineNuxtConfig({
  modules: ['nuxt-wp'],
})

Config

In order to work, you need to provide the API endpoint :

sh
WP_API_ENDPOINT=https://your-wordpress-site.com/wp-json
ts
export default defineNuxtConfig({
  wordpress:{
    apiEndpoint: 'https://your-wordpress-site.com/wp-json',
  },
})

If you want to use advances features, you need to provide Application Credentials too :

sh
WP_API_ENDPOINT=https://your-wordpress-site.com/wp-json
WP_APPLICATION_USER=your-username
WP_APPLICATION_PASSWORD=your-password
ts
export default defineNuxtConfig({
  wordpress:{
    apiEndpoint: 'https://your-wordpress-site.com/wp-json',
    applicationUser: 'your-username',
    applicationPassword: 'your-password'
  },
})