splitch

Docsllms.txt

Everything a failure can tell you.

Every page here is also served as plain markdown at the same URL with a .md suffix, and /llms.txt indexes all of them. Building with an agent? Point it at mcp.splitch.dev and it gets the same material without leaving the tools it already has.

Flags

  • FlagsPer-Environment Configuration: enabled, rollout, availableVariantNames, and Targeting Rules.

SDK

  • InstallAdd @splitch/sdk and get one Flag resolving.
  • CredentialsClient Key evaluates, API Key peeks. Pass exactly one.
  • The four methodsWhich calls fire an Exposure, and which credential each needs.
  • idempotencyKeyOne key per logical evaluation. Reuse it to retry safely.
  • Failure behaviorEvaluation never throws and never hides. Peek throws.
  • Exposure dedupRepeat evaluations replay locally. Run boundaries do not.
  • Optionsendpoint, timeoutMs, retries, logger, transport.

Errors

Every code any splitch surface can emit resolves to a page at /docs/error/{code}. Error messages print that URL, so a failure you have never seen is one click from its cause and its fix.

API (48)

Returned by the splitch API, with an HTTP status.

  • ACTIVATION_TIMESTAMP_INVALID400An activation timestamp was placed at or before the first Exposure it would filter, which would silently drop the Entities the Run already measured.
  • ALLOCATION_INVALID400The Variant allocation percentages on a Run do not sum to 100.
  • APPROVAL_APPLICATION_FAILED409The Review was authorized but applying the change failed and rolled back. Nothing was written, and the request is still pending.
  • APPROVAL_REQUEST_NOT_FOUND404No Approval Request matched the identifier in the request, within the scope your credential can reach.
  • APPROVAL_REQUEST_RESOLVED409A different Review already resolved this request.
  • APPROVAL_REQUEST_STALE409The target changed after the request was proposed, so approving it would apply a diff computed against state that no longer exists. The request is terminal.
  • APPROVAL_REVIEW_FORBIDDEN403This principal may not perform this Review.
  • APPROVAL_REVIEW_REQUIRED409The Environment Policy gates this change at `confirm`, and the call carried no inline `review`. A durable Approval Request now exists and is pending.
  • APP_MISMATCH403The credential belongs to a different App than the one the request addressed.
  • APP_NOT_FOUND404No App matched the identifier in the request, within the scope your credential can reach.
  • ATTENTION_FANOUT_LIMIT_EXCEEDED409The App-wide attention rollup spans more Environments and running Experiments than it will read in one pass. It issues one Analysis read per running Experiment per Environment, and past the budget it refuses the whole read.
  • CREDENTIAL_NOT_FOUND404No credential matched the identifier in the request, within the scope your credential can reach.
  • CREDENTIAL_REVOKED403The credential is well-formed and known, but has been revoked.
  • DECISION_LOCKED409A decision-family or alpha setting was edited on a running Run. These fix the statistical test, and moving them mid-Run invalidates the result.
  • EXPERIMENT_KEY_CONFLICT409An Experiment already holds this `(App, Environment, key)`. Archiving an Experiment does not free its key, so the holder may be archived rather than live.
  • EXPERIMENT_NOT_FOUND404No Experiment matched the identifier in the request, within the scope your credential can reach.
  • EXPERIMENT_NO_DRAFT409Start was called but the draft is identical to the Run already live. Starting it would open a second Run that measures the same configuration, splitting one cohort across two Runs for no reason.
  • EXPERIMENT_RUNNING409The operation is blocked while the Experiment has a live Run. Delete is the common one.
  • FLAG_NOT_FOUND404No Flag matched the identifier in the request, within the scope your credential can reach.
  • FORBIDDEN403The principal is authenticated but is not authorized for this resource under its Organization role.
  • IDEMPOTENCY_KEY_CONFLICT409The same idempotency key was reused with a different canonical payload. Honoring it would let one key stand for two different changes.
  • INSUFFICIENT_SCOPES403The credential is valid but does not carry the scopes this operation requires.
  • INTERNAL_SERVER_ERROR500An unhandled fault on the platform side. Nothing about the request was at fault.
  • INVALID_PAGINATION400The `cursor` or `limit` on a list request could not be used.
  • INVALID_SORT400The requested sort field is not sortable on this collection.
  • LAST_ENVIRONMENT_REQUIRED409The delete would leave an App with no Environment, and an App cannot serve without one.
  • LAST_OWNER_REQUIRED409The change would leave a shared Organization with no owner, which would strand every member without an escalation path.
  • METRIC_NOT_FOUND404No Metric matched the identifier in the request, within the scope your credential can reach.
  • MULTIPLE_VARIANT_CONFLICT409One Entity was observed under more than one Variant in the same Run, so it is bucketed to `__multiple__` and its contribution is untrusted.
  • ORGANIZATION_NOT_FOUND404No Organization matched the identifier in the request, within the scope your credential can reach.
  • ORIGIN_NOT_ALLOWED403A valid Client Key was presented from an origin that is not on that key's allow-list.
  • PRIVACY_CONFIRMATION_REQUIRED409A destructive privacy job was submitted without confirmation. These erase subject data irreversibly across every store.
  • PRIVACY_JOB_FAILED500A privacy job did not complete against every store, so subject data may remain in the ones it could not reach.
  • PRIVACY_JOB_NOT_FOUND404No privacy job matched the identifier in the request, within the scope your credential can reach.
  • RATE_LIMITED429The caller exceeded the rate budget for this surface.
  • RESOURCE_NOT_EMPTY409A destructive delete was refused because child resources still exist under the target and this delete does not cascade.
  • RUN_FROZEN409The edit touches a field that a running Run freezes. Changing it mid-flight would rebucket Entities that were already measured, so the write is refused whole.
  • RUN_NOT_FOUND404No Run matched the identifier in the request, within the scope your credential can reach.
  • RUN_NOT_RUNNING409An operation that only a live Run supports (End, for example) was called on a Run that is still a draft or already ended.
  • SEGMENT_NOT_FOUND404No Segment matched the identifier in the request, within the scope your credential can reach.
  • SERVICE_UNAVAILABLE503The edge returned HTTP 503: Provider configuration could not be resolved. This is retryable and does not mean your Flag is misconfigured.
  • SLUG_CONFLICT409The Organization slug is already taken. Slugs are a global handle, so the winner may be an Organization you cannot see.
  • TARGETING_KEY_MISMATCH409The Targeting Key changed on a Run that is already assigning traffic. Every Entity would rebucket, and the Exposures already recorded would describe a different population than the ones that follow.
  • UNAUTHORIZED401No valid credential was presented, or the one presented could not be parsed.
  • USER_NOT_FOUND404No user matched the identifier in the request, within the scope your credential can reach.
  • VALIDATION_ERROR400The request body, path, or query failed contract validation at the Worker boundary.
  • VARIANT_NOT_AVAILABLE409A referenced Variant is not promoted into this Environment. Flag definitions are App-level, but the set of Variants servable in a given Environment is per-Environment.
  • VARIANT_NOT_FOUND404No Variant matched the identifier in the request, within the scope your credential can reach.

SDK (8)

Thrown by @splitch/sdk at construction, before any request goes out.

CLI (19)

Raised by splitch itself. Each one carries the process exit code it returns.

  • CLI_API_ORIGIN_MISSINGexit 1The platform target in `SPLITCH_PLATFORM_TARGET` has no API origin configured in the environment.
  • CLI_CONFIG_READ_FAILEDexit 1`.splitch/config.json` exists but could not be read or parsed.
  • CLI_CREDENTIAL_STORE_FAILEDexit 1The credential store could not be read, written, or cleared.
  • CLI_DATA_PLANE_ERROR_CODE_MISSINGexit 4`splitch flags verify` got `reason: "ERROR"` from the data plane with no error code attached, so there is nothing to attribute the failure to.
  • CLI_DEVICE_APPROVAL_TIMEOUTexit 2The device code expired before it was approved in the browser.
  • CLI_DEVICE_AUTHORIZATION_FAILEDexit 2The device authorization request failed, or the auth service returned a response missing a required field.
  • CLI_DEVICE_TOKEN_EXCHANGE_FAILEDexit 2The device code was approved but exchanging it for a token failed, or the token response carried no `user_id` to identify the session.
  • CLI_EMAIL_UNVERIFIEDexit 2The identity provider has not verified an email address for this account.
  • CLI_LOGOUT_REVOKE_FAILEDexit 2The local credential was removed but the server refused to revoke the session, so the token may still be accepted elsewhere until it expires.
  • CLI_NOT_AUTHENTICATEDexit 2No CLI login session is available.
  • CLI_OPERATION_UNKNOWNexit 1The command resolved to an operation id that is not in the registry.
  • CLI_ROUTE_SURFACE_UNSUPPORTEDexit 1The operation the command maps to has no public origin the CLI can address.
  • CLI_SCOPE_UNRESOLVEDexit 3The App, Environment, or Flag the command addresses could not be pinned down: nothing matched the selector, more than one thing matched it, or an Environment was named without an App.
  • CLI_SERVER_CODE_UNRECOGNIZEDexit 4The server returned an error code this CLI build does not know. The message is passed through verbatim.
  • CLI_SESSION_EXPIREDexit 2A login session exists but could not mint a usable token.
  • CLI_TOKEN_BINDING_REFUSEDexit 3The session token could not be bound to the requested scope, usually because the account holds no membership that reaches it.
  • CLI_UNEXPECTED_ERRORexit 1An unhandled fault inside the CLI. The underlying message is passed through.
  • CLI_USAGE_INVALIDexit 1The invocation did not parse: an unknown command or flag, a flag missing its value, a required positional missing or supplied twice, an out-of-range value, or malformed `--body-json`.
  • CLI_VALIDATION_ERRORexit 1The invocation parsed but its input failed contract validation before any request was sent. `splitch flags create` without a variant catalog, `--variants` without `--key`, or an unrecognized `SPLITCH_PLATFORM_TARGET` all land here.