Check the Nuxt.js documentation for more information about installing and using modules in Nuxt.js.

Installation

Add nuxt-meilisearch dependency to your project:

pnpm
pnpm add -D nuxt-meilisearch
yarn
yarn add --dev nuxt-meilisearch
npm
npm i --save-dev nuxt-meilisearch

Then ddit your nuxt.config.js to load the module:

nuxt.config.js
export default defineNuxtConfig({
  ...
  modules: [
    'nuxt-meilisearch'
  ],
  ...

Basic Setup

Client Side only

The basic setup is to provide the host url and the search api key.

nuxt.config.js
  ...
  meilisearch: {
    hostUrl:  'http://my-meilisearch-server.domain.com' //reqired
    searchApiKey: '<your_search_key>' // reqired
  }
  ...
})

Advanced Setup

Client Side + Server Side

You can customization Meilisearch client meilisearchConfig.

Full documentation on Meiliserch client page for more details.

nuxt.config.js
import { defineNuxtConfig } from 'nuxt'

export default defineNuxtConfig({
  ...
  modules: [
    'nuxt-meilisearch'
  ],
  meilisearch: {
    hostUrl:  'http://my-meilisearch-server.domain.com'
    searchApiKey: '<your_search_key>',
    adminApiKey: '<your_admin_key>',
    instantSearch: true, // default false
    serverSideUsage:  false// default false
  }
  ...
})