0.5.1 • Published 2 years ago
@nuxt-modules/algolia v0.5.1
@nuxt-modules/algolia
Features
- Nuxt 3 ready
- Easy integration with Algolia
- Handy composables like useAlgolia, useSearch, etc
- TypeScript support
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
- Clone this repository
- Install dependencies using
yarn install
ornpm install
- Start development server using
yarn dev
ornpm run dev