Skip to content

Make it possible to provide custom user agent to avoid os calls? #77

Open
@karfau

Description

@karfau

🚀 Feature Proposal

Instead of relying on the node builtin os to create the user agent, it would be nice to be able to avoid those calls by configuring a the user agent string when creating the client or via an ENV variable

Motivation

In order to use the client in a runtime that restricts access to the os builtin, like https://val.town or https://deno.com/deploy (on deno deploy it works, providing (linux 0.0.0-00000000-generic-x64; Node.js v18.18.0))

Example

when creating the client instance:

const client = new Client({
  cloud: { id: '<cloud-id>' },
  auth: { apiKey: 'base64EncodedKey' },
  userAgent: 'my custom user agent string',
})

or via env variable:

process.env.ELASTICSEARCH_USER_AGENT = 'my custom user agent string';

one of the options would be good enough and maybe you are aware of even better options?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions