Vue InstantSearch is the lightning-fast search library for building search interfaces in Vue.js applications. It provides a complete set of components to build feature-rich search experiences powered by Algolia.
Vue InstantSearch supports both Vue 2 (2.6.0+) and Vue 3 (3.0.0+). The library automatically uses the correct build based on your Vue version.
Import and register Vue InstantSearch in your application.
import Vue from 'vue';import InstantSearch from 'vue-instantsearch';import App from './App.vue';Vue.use(InstantSearch);new Vue({ render: (h) => h(App),}).$mount('#app');
2
Create a search client
Initialize the Algolia search client with your credentials.
import { liteClient as algoliasearch } from 'algoliasearch/lite';const searchClient = algoliasearch( 'YOUR_APP_ID', 'YOUR_SEARCH_API_KEY');
Use your search-only API key, not your admin API key. The search-only key is safe to expose in client-side code.
3
Build your search UI
Use InstantSearch components to create your search interface.