Replay
The ScaleBun.replay namespace — 16 members.
Session Replay namespace. Provides control over session replay: recording, capture, user identity, privacy, breadcrumbs, and transport. All methods are no-op if replay feature is disabled.
import ScaleBun from '@scalebun/react-native';
ScaleBun.replay.<method>(…);Members#
| Member | Signature |
|---|---|
start | start(): Promise<void> |
stop | stop(): Promise<void> |
pause | pause(): Promise<void> |
resume | resume(): Promise<void> |
captureFrame | captureFrame(): Promise<void> |
setUser | setUser(user: ReplayUser): Promise<void> |
clearUser | clearUser(): Promise<void> |
addBreadcrumb | addBreadcrumb(breadcrumb: ReplayBreadcrumb): Promise<void> |
setPrivacy | setPrivacy(opts: Partial<ReplayPrivacyOptions>): Promise<void> |
setEnabled | setEnabled(enabled: boolean): Promise<void> |
setQuality | setQuality(quality: any): Promise<void> |
setCaptureMode | setCaptureMode(mode: any): Promise<void> |
setScreen | setScreen(name: string): Promise<void> |
flush | flush(): Promise<void> |
isRecording | isRecording: boolean |
sessionId | sessionId: string | null |
Reference#
start#
ScaleBun.replay.start(): Promise<void>stop#
ScaleBun.replay.stop(): Promise<void>pause#
ScaleBun.replay.pause(): Promise<void>resume#
ScaleBun.replay.resume(): Promise<void>captureFrame#
ScaleBun.replay.captureFrame(): Promise<void>setUser#
ScaleBun.replay.setUser(user: ReplayUser): Promise<void>clearUser#
ScaleBun.replay.clearUser(): Promise<void>addBreadcrumb#
ScaleBun.replay.addBreadcrumb(breadcrumb: ReplayBreadcrumb): Promise<void>setPrivacy#
ScaleBun.replay.setPrivacy(opts: Partial<ReplayPrivacyOptions>): Promise<void>setEnabled#
ScaleBun.replay.setEnabled(enabled: boolean): Promise<void>setQuality#
ScaleBun.replay.setQuality(quality: any): Promise<void>setCaptureMode#
ScaleBun.replay.setCaptureMode(mode: any): Promise<void>setScreen#
ScaleBun.replay.setScreen(name: string): Promise<void>flush#
ScaleBun.replay.flush(): Promise<void>isRecording#
ScaleBun.replay.isRecording: booleansessionId#
ScaleBun.replay.sessionId: string | nullNotes#
Session replay reconstructs what a user saw and did. It is the most useful diagnostic the SDK produces and the one with the most serious privacy obligations, so treat configuration as a requirement rather than a tuning exercise.
Screenshot capture needs an optional peer dependency#
Frame capture goes through react-native-view-shot, which is an optional peer dependency. Without
it installed, replay's screenshot path is unavailable — and because Metro resolves require() strings
at bundle time, an absent package needs the SDK's Metro config to stub it. See
the exports reference for that mechanism and the failure it prevents.
Ordering#
Configure masking, then enable replay
In that order, in every environment that has real users.
Set the sample rate deliberately
Replay is the most expensive thing the SDK produces, in bandwidth, in device cost and in billing — replays are metered separately from sessions. Sampling everything is rarely the right answer.
Sample the sessions you will actually watch
A high rate on healthy sessions buys you recordings nobody opens. What you want is coverage of problem sessions — the health summary reports the replay-linked share of those, and that is the number to raise.
Verify on a real device before shipping
Watch one of your own replays and look specifically at every screen with sensitive input.
Limits and edge cases#
Not a video. Replay reconstructs from captured state, so it will not perfectly reproduce native animation, video playback, or platform-drawn surfaces.
Sampled, so a specific session may not exist. You cannot retroactively record one, which is why coverage is a decision made in advance.
Subject to retention. A replay link on an older record may no longer resolve.
These calls do not throw — a replay that failed to start is silent in release builds.