Skip to main content
Install Vue InstantSearch with a packaging system or with a direct link in your web page.
1

Install Vue InstantSearch from npm

If you have a JavaScript build tool (for example if you’ve created your project using the Vue command-line tool), install Vue InstantSearch from npm:
Command line
2

Load the package

In your main js file, load the package as a Vue plugin:
This lets you use all the widgets directly in your components.
1

Add the two script tags

HTML
HTML
HTML
2

Write your Vue app within your HTML

For example in an #app div:
Vue
3

Instantiate the plugin and app

Add a script tag with the instantiation of the plugin and the app:
ais-instant-search is the root Vue InstantSearch component. All widgets must be wrapped within it.
In a production environment, secure your API keys as environment variables.

Send click and conversion events

Capturing real-time user interactions as events gives you actionable insights through click and conversion metrics, and they help you increase your customer engagement and conversions. Events are used to activate Algolia features and products like NeuralSearch, Dynamic Re-Ranking, Query Categorization, Recommend, and Personalization. To send click and conversion events when users interact with your search UI, set the insights option to true.

Optimize your build with tree shaking

Tree shaking can be done with modern build tools. The goal is to have code that’s actually used in your built site. In the context of Vue InstantSearch this means not including the widgets that aren’t used. You can do this by using the components directly, rather than the Vue.use(InstantSearch) call. In every component you’re using InstantSearch widgets, you can import and instantiate them like this:
The build tool you’re using will then be able to only include the widgets that you’re actually using.

Browser support

Algolia supports the last two versions of the major browsers (Chrome, Edge, Firefox, Safari). To support Internet Explorer 11 you need polyfills for: Array.prototype.find, Array.prototype.includes, Promise, Object.entries, and Object.assign.
The code samples in this documentation use a JavaScript syntax that isn’t natively supported by older browsers like Internet Explorer 11. If your site needs to support older browsers, use a tool like Babel to make your code work in the browsers you target.
Last modified on July 10, 2026