splitchAlpha

DocsSDKoptions.md

Options.

endpoint, timeoutMs, retries, logger, transport, onResolution.

Every option is documented in the shipped type declarations (dist/index.d.ts). These are the ones worth knowing before you read them.

OptionDefaultNotes
endpointhttps://edge.splitch.devoverride for self-hosted or preview targets
timeoutMs5000per-call timeout; a timeout is an ERROR, not a default
retries0must stay 0; reuse idempotencyKey instead
loggerconsolereceives every fail-loud report
transportbuilt-in fetch adapterinjectable seam for tests
fetchthe global fetchinjectable seam for tests and custom agents
nowDate.nowinjectable epoch-ms clock
revalidateMs60000Exposure-dedup window; a new Run is detected within it
seenSetMaxSizebounded defaultmax entries in the local Exposure-dedup cache
onResolutionunsetobservability hook; see below

onResolution

onResolution(flagKey, details) is called with every resolution the real user path produced, for observability sinks that want to know which Flags were active. It is never called for peekVariant or verify, because those fire no Exposure and reporting them would claim a resolution the user never received.

It is called synchronously and never awaited, and a throwing reporter is not caught: an observability sink that fails should fail where it fails rather than be swallowed into a silently degraded evaluation. Sentry ships a ready-made reporter for this hook.

Options that throw

These are validated at construction so a misconfigured client fails on the first line rather than corrupting Exposure data at request time.