0.5.1 • Published 2 years ago

@nuxt-modules/algolia v0.5.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@nuxt-moedules/algolia

@nuxt-modules/algolia

npm version npm downloads Github Actions CI Codecov License

Algolia module for Nuxt 3

Features

  • Nuxt 3 ready
  • Easy integration with Algolia
  • Handy composables like useAlgolia, useSearch, etc
  • TypeScript support

📖  Read the documentation

Setup

yarn add @nuxt-modules/algolia # yarn
npm i @nuxt-modules/algolia # npm

Basic usage

Firstly, you need to add @nuxt-modules/algolia to your Nuxt config.

// nuxt.config.js

{
  buildModules: [
    [
      '@nuxt-modules/algolia',
      {
        apiKey: '<YOUR_SEARCH_API_KEY>',
        applicationId: '<YOUR_APPLICATION_ID>'
      }
    ]
  ]
}

Then you can start using @nuxt-modules/algolia in your setup function!

<script setup>
const { result, search } = useSearch('test_index') // pass your index as param

onMounted(async () => {
  await search({ query: 'Samsung' });
})
</script>

Development

  1. Clone this repository
  2. Install dependencies using yarn install or npm install
  3. Start development server using yarn dev or npm run dev

License

MIT License