import com.traceitx.TraceItX
import com.traceitx.config.TraceItXConfig
import com.traceitx.config.CaptureConfig
TraceItX.start(
context,
TraceItXConfig(
appId = "txx_app_…",
sdkKey = "txx_live_…",
release = "2.4.0",
capture = CaptureConfig(network = true),
),
)
Note the import: the config lives in com.traceitx.config, not alongside
the TraceItX object.
TraceItXConfig
| Field | Type | Default | What it does |
|---|---|---|---|
appId | String | — | Required. Your app’s id. Blank throws TraceItXConfigError from start(). |
sdkKey | String | — | Required. Your SDK key. Android takes both, unlike iOS. |
environment | Environment | production | development, staging or production. |
release | String? | null | Release identifier recorded on the report. |
capture | CaptureConfig | defaults | What is captured — see below. |
bubble | Boolean | true | A hint your own code can read, nothing more. The SDK does not install a bubble — trigger UI is yours. |
useDynamicColor | Boolean | false | Not read. The reporter never applies Material You colours; theme it with theme instead. |
companionDeviceId | String? | null | An MDM id or serial you already trust, hashed on the device before it is sent. |
companionBadgeEnabled | Boolean | true | Show the companion pairing badge on TV. |
companionBadgePosition | String? | null | bottom-right, bottom-left, top-right, top-left. Anything else falls back to bottom-right. |
theme | ReporterThemeOptions? | null | Reporter colours. See Branding. |
installIdentifierEnabled | Boolean | true | Send a per-install identifier so distinct installs count toward your plan. Nothing about the person is derived from it. false turns it off locally; it can never force it on. |
vitals | VitalsConfig | VitalsConfig() | Session Vitals opt-out / sample rate / source-query capture. See Session vitals. |
bubble is easy to misread: it does not make the SDK draw anything. It is a
flag your own code can inspect to decide whether to render a floating trigger,
kept so a host can carry that preference in config rather than beside it.
CaptureConfig
| Field | Default | What it does |
|---|---|---|
screenshot | true | Not read. The reporter always takes a screenshot. |
focus | true | Not read. Focused-component capture is not implemented on Android. |
logs | true | Capture Timber output and anything written to System.out / System.err. Plain android.util.Log calls are not captured. |
network | false | Gates body capture only. Request metadata is recorded whenever the OkHttp interceptor is attached — see Console & network. |
crash | true | Uncaught exceptions become unattended reports. |
ringBufferCapacity | 250 | Not read — the log and network buffers are each fixed at 100 entries. 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. |
Body capture is effective only when network is true, networkBodies is not
false, and the server has it on: a client can turn it off and can never
turn it on. See Network bodies and
Server config.
Runtime methods
| Method | What it does |
|---|---|
report.open() | suspend. Opens the reporter, returns on submit or cancel. openAsync(callback) for a callback form. |
report.isPresenting | StateFlow<Boolean> — true while the reporter is up. Use it to disable your trigger. |
setUser(user) | Attach or clear the end user. null clears. No-op before start(). See Identity. |
setIdentityToken(source) | Supply a verified identity instead of a self-asserted one. null signs out. |
addBreadcrumb(message, kind, level, data) | Add a custom entry to the trail. |
recordScreen(name, data) | Mark a screen transition. See Screen tracking. |
setExtra(value) / clearExtra() | Free-form string attached to the next report, then cleared. Each call replaces the last. |
markSensitive(view) | Mask a view. See Sensitive content. |
startCompanion() / stopCompanion() | Companion mode for TV apps. See Android TV. |
kill() | Stop the SDK and drop buffered evidence for this session. |
requestOutboxDrain() | Flush the outbox now rather than on its own schedule. |
kill() is the switch for a user withdrawing consent mid-session: it stops
capture and discards what is already buffered, which is the distinction that
matters if the reason for calling it is that something sensitive just appeared.
Reading current state
TraceItX.captureGate // Boolean — is capture actually allowed?
TraceItX.currentConfig // TraceItXConfig?
TraceItX.currentUser // TXUser?
TraceItX.captureUserSnapshot() // TXCapturedUser
TraceItX.captureSessionSnapshot()
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 Android does not have
No debug, disabled or onError field. No setMetadata — use setExtra.
No client-side redaction config: redaction is not configurable from
TraceItXConfig on this SDK. No sessionReplay block — replay is enabled
entirely from the server.
Two-way replies are not implemented in the Android SDK. The server block is decoded for compatibility, but 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.