Core configuration
Create core configuration withConfigurationBuilder and pass it to Flashcat.initialize().
Flashcat.initialize() initializes a given instance name only once. A duplicate call returns the existing instance and does not re-register feature modules.Tracking consent
PassTrackingConsent during initialization. You can also update it at runtime with Flashcat.setTrackingConsent().
RUM configuration
Create RUM configuration withRumConfigurationBuilder and pass it to FlashcatRum.enable().
Event mapping and redaction
UsesetEventMapper() to perform lightweight processing before events are reported. Return the modified event to keep it, or null to drop it.
Global attributes and user information
Global attributes are merged into thecontext object on subsequent events.
id, name, and email are written to the usr object on subsequent events.
Trace configuration
The Trace module generates W3Ctraceparent and tracestate, then correlates the generated trace id and span id to RUM resources through _dd.trace_id and _dd.span_id. tracestate carries the Datadog vendor entry dd=s:{0|1};o:rum.
setFirstPartyHosts() is currently used only by the FlashcatHttp wrapper. The rcp interceptor itself is an explicit per-session opt-in, so requests made through a session with the interceptor receive Trace headers. If a request already has traceparent, the SDK does not overwrite the existing Trace context. Existing tracestate keeps other vendors and moves the updated dd= member to the front.Crash reporting configuration
The Crash module listens to HarmonyOShiAppEvent for APP_CRASH and APP_FREEZE. The system replays fault events on the next launch, and the SDK reports them through the RUM error pipeline.
Background and deferred upload
By default, the SDK uploads on the foreground cadence configured bysetBatchUploadFrequencyMs() and triggers flush() when the application backgrounds. If you want HarmonyOS WorkScheduler to wake the app for uploads, register deferred upload work.
The SDK registers the WorkScheduler task. When your
WorkSchedulerExtensionAbility wakes, call Flashcat.flushAndWait() to perform a bounded batch drain.Upload HarmonyOS crash symbols
To de-obfuscate ArkTS stacks and symbolicate native.so stacks in the console, upload build artifacts with @flashcatcloud/hvigor-plugin.
The plugin uploads two artifact types:
The plugin ships as an npm package (on npm, not ohpm); install it as a build-time dev dependency in your project’s root
package.json, not in oh-package.json5:
hvigorfile.ts:
hvigorfile.ts
flashcatSymbolUploadPlugin() also accepts two optional fields: buildDir (build output directory, default build/default) and pluginVersion (the version sent in the DD-EVP-ORIGIN-VERSION upload header, default 0.1.0). Neither is normally required.multipart/form-data to {endpoint}/sourcemap/upload:
Upload event types: