From 84acdd32475ea62cde135fac66f4c79b3650f8ea Mon Sep 17 00:00:00 2001 From: vvo Date: Tue, 15 Dec 2015 15:27:17 +0100 Subject: [PATCH] chore(version): add specific algolia agent and version --- src/lib/DocSearch.js | 2 ++ src/lib/main.js | 2 ++ src/lib/version.js | 1 + 3 files changed, 5 insertions(+) create mode 100644 src/lib/version.js diff --git a/src/lib/DocSearch.js b/src/lib/DocSearch.js index 3e17b754..f7f7a4f6 100644 --- a/src/lib/DocSearch.js +++ b/src/lib/DocSearch.js @@ -3,6 +3,7 @@ import algoliasearch from 'algoliasearch'; import autocomplete from 'autocomplete.js'; import templates from './templates.js'; import utils from './utils.js'; +import version from './version.js'; import $ from 'npm-zepto'; /** @@ -38,6 +39,7 @@ class DocSearch { this.checkArguments({apiKey, indexName, inputSelector, algoliaOptions, autocompleteOptions}); this.client = algoliasearch('BH4D9OD16A', this.apiKey); + this.client.addAlgoliaAgent('docsearch.js ' + version); this.autocomplete = autocomplete(this.input, autocompleteOptions, [{ source: this.getSource(), templates: { diff --git a/src/lib/main.js b/src/lib/main.js index 1c4c4f4e..8f91873c 100644 --- a/src/lib/main.js +++ b/src/lib/main.js @@ -1,6 +1,8 @@ import toFactory from 'to-factory'; import DocSearch from './DocSearch'; +import version from './version.js'; let docSearch = toFactory(DocSearch); +docSearch.version = version; export default docSearch; diff --git a/src/lib/version.js b/src/lib/version.js new file mode 100644 index 00000000..8b2ab62c --- /dev/null +++ b/src/lib/version.js @@ -0,0 +1 @@ +export default '0.0.1';