Quick start


Setup

  1. Install Algolia module
npx nuxi@latest module add algolia
  1. Add ALGOLIA_API_KEY and ALGOLIA_APPLICATION_ID to the .env
ALGOLIA_API_KEY="0fd1c4eba2d831788333e77c9d855f1d"
ALGOLIA_APPLICATION_ID="AGN9HEEKF3"
  1. Use Algolia in your application

Client side:

<script setup lang="ts">const { result, search } = useAlgoliaSearch('test_index')onMounted(async () => {  await search({ query: 'Samsung' })})</script><template>  <div>{{ result }}</div></template>

Or SSR:

<script setup lang="ts">const { data } = await useAsyncAlgoliaSearch({ indexName: 'test_index', query: 'Samsung' })</script><template>  <div>{{ data }}</div></template>
That's it! You can now use Algolia in your Nuxt app ✨