elastic / app-search-javascript

Elastic App Search Official JavaScript Client
https://www.elastic.co/products/app-search
Apache License 2.0
66 stars 21 forks source link

[Client Telemetry] Enables reporting meta headers for client usage based telemetry #38

Closed joemcelroy closed 2 years ago

joemcelroy commented 2 years ago

This PR adds to the request a http header x-elastic-client-meta which contains information about the client thats used to perform the request on cloud. This header is used to track client usage on cloud. The value follows a spec documented here and is validated based on a regex mentioned in the spec doc.

-legacy is included to differentiate it between the new universal enterprise search client and the current, in-use client which is deemed "legacy". If the client is run within the browser, we use browser for the JS version value. If its running in node context, use the nodejs version.