@dvxch/yandex-music
    Preparing search index...

    Interface ClientOptions

    Options accepted by the Client constructor.

    interface ClientOptions {
        baseUrl?: string;
        device?: string;
        fetch?: FetchLike;
        headers?: Record<string, string>;
        language?: string;
        onUnknownField?: UnknownFieldReporter;
        reportUnknownFields?: boolean;
        request?: Request;
        retries?: number;
        retryBaseMs?: number;
        retryMaxMs?: number;
        token?: string;
        userAgent?: string;
    }
    Index

    Properties

    baseUrl?: string

    Override the API origin. Defaults to DEFAULT_BASE_URL.

    device?: string

    Device descriptor for queue requests. Defaults to DEFAULT_DEVICE.

    fetch?: FetchLike

    A custom fetch implementation (e.g. node-wreq for browser TLS impersonation). Ignored when request is supplied. Defaults to global fetch.

    headers?: Record<string, string>

    Extra headers merged onto the defaults. Ignored when request is supplied.

    language?: string

    Response language. Defaults to ru. One of en/uz/uk/us/ru/kk/hy.

    onUnknownField?: UnknownFieldReporter

    A hook called whenever the API returns fields the library does not model. Setting it enables detection (no need to also set reportUnknownFields) and routes reports here instead of to console.warn — wire it to your logger, metrics or a test assertion.

    reportUnknownFields?: boolean

    When true, log a warning (via console.warn) whenever the API returns a field the library does not yet model. Useful for spotting upstream API changes. Ignored when ClientOptions.onUnknownField is set.

    request?: Request

    A pre-configured Request transport (custom headers, proxy, timeout).

    retries?: number

    Retries for transient failures on idempotent (GET) requests. Defaults to 2 (3 attempts). Set 0 to disable. Ignored when request is supplied.

    retryBaseMs?: number

    Initial retry backoff in ms. Defaults to 300. Ignored when request is supplied.

    retryMaxMs?: number

    Maximum retry backoff in ms. Defaults to 4000. Ignored when request is supplied.

    token?: string

    OAuth token used to authenticate requests.

    userAgent?: string

    User-Agent value. Ignored when request is supplied. Defaults to the library UA.