Skip to Content
Pyxis Docs

SDK reference

API of @pyxis-hq/wallets-kit.

npm install @pyxis-hq/wallets-kit

Zero runtime dependencies, ESM and CJS with types, SSR-safe. Currently 0.1.0-beta.0.

Entry points

ImportContents
@pyxis-hq/wallets-kitPyxisWallet, createPyxisWallet, isWalletEvent, WALLET_EVENTS, WALLET_PROVIDERS, NETWORKS, SDK_VERSION and the types
@pyxis-hq/wallets-kit/reactPyxisProvider, usePyxis

Options

OptionDefaultDescription
endpointnoneFull URL of /v1/wallet-events
ingestKeynoneThe pyx_live_... key
networktestnettestnet, public or other
enabledtrueWire to your consent control
respectDoNotTracktrueHonour Do Not Track and Global Privacy Control
maxQueue100Oldest events are dropped beyond this
batchSize20Events per request, 1 to 50
flushIntervalMs5000Periodic flush
debugfalseLog decisions to the console; the key is never logged
fetchImplglobal fetchCustom fetch, for tests

Methods

MethodDescription
track(event, props?)Queue an event. Never throws and never waits on the network
flush()Send queued events now. Never rejects
setEnabled(boolean)Turn tracking on or off; turning it off clears the queue
stats(){ queued, sent, dropped, rejected, disabled, circuitOpen }
destroy()Stop timers and listeners, clear the queue
queued, droppedCountCounters

Delivery behaviour

SituationWhat the SDK does
Page hidden or closedFlushes with keepalive
5xx, 429, network errorRetries with backoff and jitter, up to 5 times, then drops
413Splits the batch and resends
Other 4xxDrops the batch, no retry
Three consecutive 401 or 403Opens a circuit breaker and stops sending (stats().circuitOpen)
Server-side renderingNothing starts until the first track, so importing is safe

Not yet built: the Stellar Wallets Kit adapter that captures events automatically, and an OpenTelemetry helper.

On this page