try TraceItX.shared.start(
config: TraceItXConfig(
appId: "txx_live_…",
capture: CaptureConfig(network: true)
)
)
TraceItXConfig
| Field | Type | Default | What it does |
|---|---|---|---|
appId | String | — | Required. Your SDK key. Publishable — it only grants report submission. |
environment | Environment | .production | .development, .staging or .production. Currently not read — nothing in the report changes. |
release | String? | nil | Currently not read. The report’s app version comes from your bundle’s CFBundleShortVersionString and CFBundleVersion. |
capture | CaptureConfig | .defaults | What is captured — see below. |
redaction | RedactionConfig | .defaults | Currently not read — the engine ships a fixed rule set. See Redaction. |
companionDeviceId | String? | nil | An MDM id or serial you already trust, hashed natively before it leaves the device. |
companionBadgeEnabled | Bool | true | Show the phone-pairing badge on TV. |
companionBadgePosition | String? | nil | bottom-right, bottom-left, top-right, top-left. Anything else falls back to bottom-right. |
theme | ReporterThemeOptions? | nil | Reporter colours. See Branding. |
installIdentifierEnabled | Bool | true | Send a non-secret per-install identifier at most once a day so installs can be counted toward your plan. Client veto: false turns it off; it cannot force it on. |
vitals | VitalsConfig | VitalsConfig() | Session Vitals opt-out / sample rate / source-query capture. See Session vitals. |
CaptureConfig
| Field | Default | What it does |
|---|---|---|
screenshot | true | Capture a screenshot with the report. |
logs | true | Capture console output (stderr). |
network | false | Declares that you have opted into network capture. On its own it captures nothing — requests are captured only on a URLSession you build with networkCaptureConfiguration(). It is a precondition for body capture. See Console & network. |
crash | true | Read only by the React Native bridge’s crash path. A native host’s uncaught exceptions become breadcrumbs, not reports — see Crash reporting. |
focus | true | Currently not read. Focus capture is not implemented on iOS. |
ringBufferCapacity | 250 | Currently not read — the buffers are fixed-size. Setting it has no effect. |
networkBodies | true | Client veto for body capture. false always wins; true does not force capture on — the server gate still decides. |
networkBodies is a veto, not a switch: bodies are captured only when the
server enables them and capture.network is true and networkBodies
is not false. A client can turn body capture off and can never turn it on.
See Server config.
Runtime methods
Config is set once; these are called whenever.
| Method | What it does |
|---|---|
report.open() | async throws. Opens the reporter, returns on submit or cancel. Throws unless TXReporterPresenter.installResolver() ran at launch. |
networkCaptureConfiguration(base:) | Returns a URLSessionConfiguration whose sessions are captured. See Console & network. |
setUser(_:) | Attach or clear the end user. nil clears. No-op before start() and after kill(). See Identity. |
setIdentityToken(_:) | Supply a verified identity instead of a self-asserted one. |
addBreadcrumb(message:kind:level:data:) | Add a custom entry to the trail. |
recordScreen(_:data:) | Mark a screen transition. See Screen tracking. |
setMetadata(_:) | Currently not read — nothing reaches the report. Use setExtra. |
setExtra(_:) / clearExtra() | Free-form string on the next report, truncated at TraceItX.EXTRA_MAX_CHARS. Each call replaces the previous value; it is cleared once a report opens. |
markSensitive(_:) | Mask a UIView. Main thread only. See Sensitive content. |
kill() | Stop the SDK and drop buffered evidence for this session. |
Reading current state
TraceItX.shared.captureGate // Bool — is capture actually allowed?
TraceItX.shared.currentConfig // TraceItXConfig?
TraceItX.shared.currentUser // TXUser?
TraceItX.shared.captureUserSnapshot() // TXCapturedUser
TraceItX.shared.captureSessionSnapshot()
TraceItX.SDK_VERSION // String
captureGate reports whether capture is armed — start() opens it and
kill() closes it. It is not a summary of the server
feature gates: replay and body capture have their own, so captureGate can be
true while neither is running.
What iOS does not have
There is no debug, disabled or onError field, and no client-side
sessionReplay block — replay is enabled entirely from the server.
Two-way replies are not implemented in the iOS SDK. There is no reply UI and no polling; the feature is web-only today.
To keep TraceItX out of a build, do not call start.