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.
| Option | Default | Notes |
|---|---|---|
endpoint | https://edge.splitch.dev | override for self-hosted or preview targets |
timeoutMs | 5000 | per-call timeout; a timeout is an ERROR, not a default |
retries | 0 | must stay 0; reuse idempotencyKey instead |
logger | console | receives every fail-loud report |
transport | built-in fetch adapter | injectable seam for tests |
fetch | the global fetch | injectable seam for tests and custom agents |
now | Date.now | injectable epoch-ms clock |
revalidateMs | 60000 | Exposure-dedup window; a new Run is detected within it |
seenSetMaxSize | bounded default | max entries in the local Exposure-dedup cache |
onResolution | unset | observability 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.
- SDK_RETRIES_INVALID:
retriesis anything but0. - SDK_SEEN_SET_MAX_SIZE_INVALID: the dedup seen-set bound is not a positive integer.
- SDK_SEEN_SET_TTL_INVALID: the dedup TTL is not a positive duration.
splitch