InstantSearch.js
Vanilla JavaScript - framework independent
React InstantSearch
For React 16.8+ applications
Vue InstantSearch
For Vue 2.6+ and Vue 3+ applications
Prerequisites
Before installing InstantSearch, you’ll need:- Node.js 14+ and npm/yarn/pnpm
- An Algolia account with an application and API keys
- An index with searchable data
InstantSearch.js (Vanilla JavaScript)
InstantSearch.js is the core library that works with any JavaScript project, regardless of framework.Package Installation
Install bothinstantsearch.js and algoliasearch:
Package Details
- instantsearch.js (v4.90.0) - The InstantSearch library with widgets and UI components
- algoliasearch (>= 3.1 < 6) - The Algolia search client (peer dependency)
Optional: CSS Themes
InstantSearch comes with pre-built CSS themes. Install the CSS package for ready-to-use styling:CDN Usage
For quick prototyping or simple projects, use the CDN:React InstantSearch
React InstantSearch provides React components and hooks for building search UIs.Package Installation
Package Details
- react-instantsearch (v7.26.1) - React components and hooks
- algoliasearch (>= 3.1 < 6) - The Algolia search client (peer dependency)
Peer Dependencies
Ensure you have the required React versions:- react >= 16.8.0 < 20
- react-dom >= 16.8.0 < 20
React InstantSearch requires React 16.8+ for hooks support. If you’re using an older version of React, you’ll need to upgrade first.
TypeScript Support
React InstantSearch includes TypeScript definitions out of the box. No additional@types packages are needed.
CSS Themes
Optionally install the CSS package:Vue InstantSearch
Vue InstantSearch provides Vue components compatible with both Vue 2 and Vue 3.Package Installation
Package Details
- vue-instantsearch (v4.24.0) - Vue 2 and Vue 3 components
- algoliasearch (>= 3.32.0 < 6) - The Algolia search client (peer dependency)
Peer Dependencies
Vue InstantSearch supports both Vue versions:- vue ^2.6.0 || >=3.0.0-rc.0
Vue Version Support
The package includes builds for both Vue 2 and Vue 3:- Vue 2: Imports from
vue-instantsearch/vue2 - Vue 3: Imports from
vue-instantsearch/vue3
Plugin Registration
For Vue 2, register the plugin:CSS Themes
Optionally install the CSS package:Server-Side Rendering (Optional)
If you’re using server-side rendering:Next.js (React)
Install the Next.js-specific package:Nuxt.js (Vue)
Vue InstantSearch includes SSR support out of the box. For Nuxt, install the optional server renderer:TypeScript Configuration
InstantSearch.js with TypeScript
InstantSearch.js includes TypeScript definitions. Depending on your Algolia client version, you may need additional type packages:For algoliasearch v4.x
For algoliasearch v3.x (deprecated)
Verify Installation
After installation, verify everything is working by importing the packages:- JavaScript
- React
- Vue
Next Steps
Now that you have InstantSearch installed, you’re ready to build your first search UI:Quick Start Guide
Follow our quick start guide to create your first search interface in minutes
Browser Support
InstantSearch supports the last two versions of major browsers:- Chrome
- Edge
- Firefox
- Safari