-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recommend client is incorrectly sending Search user agents #1507
Comments
Algolia for JavaScript is still relevant for recommend, no? |
IMHO this segment can stay because what differentiates the clients are those next segments algoliasearch-client-javascript/packages/recommend/src/builds/node.ts Lines 39 to 42 in 252228a
Keeping the |
I guess the question boils down to:
|
All! It's clearer in the next major version as all clients can be used as standalone but it's mostly to identify the language associated to the API client for usage purposes, the other languages also have that notion |
Actual
The Recommend client uses the same transporter utilities as the Search client, including the
createUserAgent
function. This causes it to set the "Algolia for JavaScript" user agent, which corresponds to Algolia Search, becausecreateUserAgent
sets this value by default. That's likely because the transporter was initially designed solely for the Search API, before Recommend existed.Additionally, the Recommend passes it its own version to
createUserAgent
, resulting in the Search client agent being sent with the Recommend client version.Expected
The Recommend client shouldn't send Algolia Search user agents at all.
Suggested solution
The
createUserAgent
function shouldn't set "Algolia for JavaScript" by default. Instead, this agent should be added in the build of the Search client.The text was updated successfully, but these errors were encountered: