create-instantsearch-app
.
With a packaging system
If you have a JavaScript build tool, you can install InstantSearch.js from npm:JavaScript
instantsearch
is the root InstantSearch.js component.
All widgets must be wrapped within it
In a production environment, secure your API keys as environment variables.
Directly in your page
This method uses the version of InstantSearch.js from the jsDelivr CDN:HTML
instantsearch
function in the global scope (window
).
JavaScript
instantsearch
is the root InstantSearch.js component.
All widgets must be wrapped within it
In a production environment, secure your API keys as environment variables.
Load the styles
You need to manually load the companion CSS file into your page:HTML
HTML
With create-instantsearch-app
Use create-instantsearch-app
to create a working InstantSearch app.
Similar to other interactive command-line applications, run it with npm
or yarn
:
Send click and conversion events
Capturing real-time user interactions as events gives you actionable insights via 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 theinsights
option to true
.
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.