Skip to content
TraceItX Docs
Documentation

Configuration

One config struct passed to start(). Everything the iOS and tvOS SDK accepts — including the fields it accepts but does not read yet.

Updated

try TraceItX.shared.start(
    config: TraceItXConfig(
        appId: "txx_live_…",
        capture: CaptureConfig(network: true)
    )
)

TraceItXConfig

FieldTypeDefaultWhat it does
appIdStringRequired. Your SDK key. Publishable — it only grants report submission.
environmentEnvironment.production.development, .staging or .production. Currently not read — nothing in the report changes.
releaseString?nilCurrently not read. The report’s app version comes from your bundle’s CFBundleShortVersionString and CFBundleVersion.
captureCaptureConfig.defaultsWhat is captured — see below.
redactionRedactionConfig.defaultsCurrently not read — the engine ships a fixed rule set. See Redaction.
companionDeviceIdString?nilAn MDM id or serial you already trust, hashed natively before it leaves the device.
companionBadgeEnabledBooltrueShow the phone-pairing badge on TV.
companionBadgePositionString?nilbottom-right, bottom-left, top-right, top-left. Anything else falls back to bottom-right.
themeReporterThemeOptions?nilReporter colours. See Branding.
installIdentifierEnabledBooltrueSend 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.
vitalsVitalsConfigVitalsConfig()Session Vitals opt-out / sample rate / source-query capture. See Session vitals.

CaptureConfig

FieldDefaultWhat it does
screenshottrueCapture a screenshot with the report.
logstrueCapture console output (stderr).
networkfalseDeclares 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.
crashtrueRead only by the React Native bridge’s crash path. A native host’s uncaught exceptions become breadcrumbs, not reports — see Crash reporting.
focustrueCurrently not read. Focus capture is not implemented on iOS.
ringBufferCapacity250Currently not read — the buffers are fixed-size. Setting it has no effect.
networkBodiestrueClient 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.

MethodWhat 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.