Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
searchParameters = {},
urlSync = null,
searchFunction
}) {
super();
if (appId === null || apiKey === null || indexName === null) {
const usage = `
Usage: instantsearch({
appId: 'my_application_id',
apiKey: 'my_search_api_key',
indexName: 'my_index_name'
});`;
throw new Error(usage);
}
const client = algoliasearch(appId, apiKey);
client.addAlgoliaAgent(`instantsearch.js ${version}`);
this.client = client;
this.helper = null;
this.indexName = indexName;
this.searchParameters = {...searchParameters, index: indexName};
this.widgets = [];
this.templatesConfig = {
helpers: createHelpers({numberLocale}),
compileOptions: {}
};
if (searchFunction) {
this._searchFunction = searchFunction;
}