Skip to content

Commit f6f55ea

Browse files
Merge #548
548: Pass strapi client agent to meilisearch-js r=bidoubiwa a=bidoubiwa Spread the strapi agent to meilisearch-js Co-authored-by: Charlotte Vermandel <[email protected]>
2 parents 20bda1d + eaa18ec commit f6f55ea

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

connectors/meilisearch/client.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict'
22
const { MeiliSearch } = require('meilisearch')
3+
const packageJson = require('../../package.json')
34

45
/**
56
* Custom Meilisearch Error class more suited to Strapi environment.
@@ -35,7 +36,10 @@ class MeiliSearchError extends Error {
3536
*/
3637
module.exports = config => {
3738
try {
38-
return new MeiliSearch(config)
39+
return new MeiliSearch({
40+
...config,
41+
clientAgents: [`Meilisearch Strapi ${packageJson.version}`],
42+
})
3943
} catch (e) {
4044
console.error(e)
4145
throw new MeiliSearchError({

0 commit comments

Comments
 (0)