@pi0/algolia
v1.1.5
Published
Algolia module for Nuxt
Downloads
5
Maintainers
Readme
@nuxtjs/algolia
Features
- Nuxt 3 ready
- Easy integration with Algolia
- Handy composables like useAlgolia, useSearch, etc
- Support for Vue Instantsearch components
- Support for Algolia Recommend
- Support for Docsearch
- Support for Automatic Indexing
- TypeScript support
Preview
Setup
yarn add @nuxtjs/algolia # yarn
npm i @nuxtjs/algolia # npm
Basic usage
Firstly, you need to add @nuxtjs/algolia
to your Nuxt config.
// nuxt.config.js
{
modules: [
"@nuxtjs/algolia",
],
algolia: {
apiKey: "<YOUR_SEARCH_API_KEY>",
applicationId: "<YOUR_APPLICATION_ID>",
}
}
Then you can start using @nuxtjs/algolia
in your setup function!
<script setup>
const { result, search } = useAlgoliaSearch("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