@@ -12,6 +12,9 @@ import $ from 'npm-zepto';
1212 * @param {string } options.apiKey Read-only API key
1313 * @param {string } options.indexName Name of the index to target
1414 * @param {string } options.inputSelector CSS selector that targets the input
15+ * @param {string } [options.appId] Lets you override the applicationId used.
16+ * If using the default Algolia Crawler, you should not have to change this
17+ * value.
1518 * @param {Object } [options.algoliaOptions] Options to pass the underlying Algolia client
1619 * @param {Object } [options.autocompleteOptions] Options to pass to the underlying autocomplete instance
1720 * @return {Object }
@@ -28,6 +31,7 @@ class DocSearch {
2831 apiKey,
2932 indexName,
3033 inputSelector,
34+ appId = 'BH4D9OD16A' ,
3135 algoliaOptions = {
3236 hitsPerPage : 5
3337 } ,
@@ -39,12 +43,13 @@ class DocSearch {
3943 DocSearch . checkArguments ( { apiKey, indexName, inputSelector, algoliaOptions, autocompleteOptions} ) ;
4044
4145 this . apiKey = apiKey ;
46+ this . appId = appId ;
4247 this . indexName = indexName ;
4348 this . input = DocSearch . getInputFromSelector ( inputSelector ) ;
4449 this . algoliaOptions = algoliaOptions ;
4550 this . autocompleteOptions = autocompleteOptions ;
4651
47- this . client = algoliasearch ( 'BH4D9OD16A' , this . apiKey ) ;
52+ this . client = algoliasearch ( this . appId , this . apiKey ) ;
4853 this . client . addAlgoliaAgent ( 'docsearch.js ' + version ) ;
4954 this . autocomplete = autocomplete ( this . input , autocompleteOptions , [ {
5055 source : this . getAutocompleteSource ( ) ,
0 commit comments