Skip to main content

Constructor

Environments

The SDK refuses to use pk_live_ in a browser environment (typeof window !== 'undefined') unless you set dangerouslyAllowBrowser: true. Use this for testing only.

Retries

Automatic for idempotent verbs (GET, DELETE) and write verbs on safe codes (502, 503, 504, 429). On 429 we honour Retry-After. Anything else is your decision.

Logging

Levels: debug (HTTP roundtrips), info (SSE reconnects, webhook resume), warn (retries), error (terminal failures).

Custom HTTP

Useful for Node 18 with old fetch, or for inserting a proxy / mock.