API key. Must match nsy_(live|test)_.... Test keys are validated separately
and are free; live keys require email verification and are billed.
The key is stored in a Symbol-keyed private property — JSON.stringify(client)
and util.inspect(client) both redact it to [REDACTED].
OptionalbaseOverride the API base URL. Must be HTTPS (except localhost / 127.0.0.1
/ [::1] for local dev). Defaults to the production URL.
OptionaltimeoutPer-attempt timeout in milliseconds. Default 30_000.
OptionalretriesRetry policy. Pass a number for shorthand (retries: 5) or a full
RetryConfig object. Default 3 retries, exponential backoff with
decorrelated jitter, capped at 60s.
OptionaluserSuffix to append to the SDK's built-in User-Agent string.
Example: "my-app/1.2.0".
OptionalfetchCustom fetch implementation — useful for connection pooling via
undici.Agent, corporate proxies, or test mocks. Defaults to global
fetch (Node 18.17+).
OptionalloggerStructured logger. Any object with debug/info/warn/error methods
works (pino, winston, bunyan, console). Default: no-op (silent).
The SDK never logs request bodies or the Authorization header.
OptionalallowEscape hatch for running in a browser environment. Normally the SDK
refuses to instantiate if window is defined, because API keys would
leak to end users. Only set true for trusted internal tools where
the browser is behind authentication and the user is the key owner.
OptionaldefaultExtra headers applied to every request (lowest precedence — per-call
RequestOptions.headers override these).
Constructor options for NessyClient.