ScaleBun
Skip to article

Replay

react-nativeDeveloperv0.1.0-alpha.4

The ScaleBun.replay namespace — 16 members.

Updated Reviewed

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.

TypeScript
import ScaleBun from '@scalebun/react-native';
ScaleBun.replay.<method>(…);

Members#

MemberSignature
startstart(): Promise<void>
stopstop(): Promise<void>
pausepause(): Promise<void>
resumeresume(): Promise<void>
captureFramecaptureFrame(): Promise<void>
setUsersetUser(user: ReplayUser): Promise<void>
clearUserclearUser(): Promise<void>
addBreadcrumbaddBreadcrumb(breadcrumb: ReplayBreadcrumb): Promise<void>
setPrivacysetPrivacy(opts: Partial<ReplayPrivacyOptions>): Promise<void>
setEnabledsetEnabled(enabled: boolean): Promise<void>
setQualitysetQuality(quality: any): Promise<void>
setCaptureModesetCaptureMode(mode: any): Promise<void>
setScreensetScreen(name: string): Promise<void>
flushflush(): Promise<void>
isRecordingisRecording: boolean
sessionIdsessionId: string | null

Reference#

start#

TypeScript
ScaleBun.replay.start(): Promise<void>

stop#

TypeScript
ScaleBun.replay.stop(): Promise<void>

pause#

TypeScript
ScaleBun.replay.pause(): Promise<void>

resume#

TypeScript
ScaleBun.replay.resume(): Promise<void>

captureFrame#

TypeScript
ScaleBun.replay.captureFrame(): Promise<void>

setUser#

TypeScript
ScaleBun.replay.setUser(user: ReplayUser): Promise<void>

clearUser#

TypeScript
ScaleBun.replay.clearUser(): Promise<void>

addBreadcrumb#

TypeScript
ScaleBun.replay.addBreadcrumb(breadcrumb: ReplayBreadcrumb): Promise<void>

setPrivacy#

TypeScript
ScaleBun.replay.setPrivacy(opts: Partial<ReplayPrivacyOptions>): Promise<void>

setEnabled#

TypeScript
ScaleBun.replay.setEnabled(enabled: boolean): Promise<void>

setQuality#

TypeScript
ScaleBun.replay.setQuality(quality: any): Promise<void>

setCaptureMode#

TypeScript
ScaleBun.replay.setCaptureMode(mode: any): Promise<void>

setScreen#

TypeScript
ScaleBun.replay.setScreen(name: string): Promise<void>

flush#

TypeScript
ScaleBun.replay.flush(): Promise<void>

isRecording#

TypeScript
ScaleBun.replay.isRecording: boolean

sessionId#

TypeScript
ScaleBun.replay.sessionId: string | null

Notes#

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#

  1. Configure masking, then enable replay

    In that order, in every environment that has real users.

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

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

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

Replay · API reference · React Native SDK · ScaleBun