Skip to content

DropInClientOptions

apiKey: string;

optional fetch?: (input, init?) => Promise<Response>;

Transport, defaulting to the global fetch. Every request this client makes goes through it, the 401 replay included.

The point is testing without a network: @dropinnodex/testing hands over an in-memory dropin as a fetch, and the REAL client runs above it — token caching, the single-flight refresh, the retry-once rule, error parsing, cursor encoding. A fake that implemented this class’s interface instead would bypass exactly the code most worth exercising. Also useful for a custom agent, a proxy, or instrumentation.

Parameter Type
input string | URL | Request
init? RequestInit

Promise<Response>


tokenProvider: () => Promise<string>;

Called on init and again on a 401 — the same contract GetStream’s SDK uses.

Promise<string>


optional url?: string;

Base URL of the dropin API. Defaults to https://api.getnodex.cloud; set it to point at staging, a proxy, or a local server — e.g. http://localhost:3000. No trailing slash.