Configuration reference

Every option the SDK actually accepts. If it's not on this page, it doesn't exist in the SDK . don't pass it.

Web . Galacha.init(config)

Core

OptionTypeDefaultDescription
projectKeystringrequiredLong hex token from the project page in the dashboard
apiUrlstringhttps://api.galacha.meAPI endpoint
identifierstringShorthand for calling identify() right after init()
traitsobjectUser traits to attach alongside identifier

Capture toggles

OptionTypeDefaultDescription
captureNetworkbooleantrueCapture fetch and XHR
captureErrorsbooleantrueAuto-capture unhandled errors
captureConsolebooleantrueCapture console.log/warn/error

Privacy

OptionTypeDefaultDescription
maskInputsbooleantrueMask all <input> / <textarea> values

Buffering

OptionTypeDefaultDescription
flushIntervalMsnumber5000How often the event buffer flushes to the API
flushMaxEventsnumber50Flush sooner if the buffer grows past this
sessionTimeoutMsnumber1800000Idle ms before a new session starts. Default 30 min

Sampling (rrweb)

OptionTypeDefaultDescription
sampling.mousemovenumber | falseThrottle mousemove capture (ms), or disable with false
sampling.scrollnumberThrottle scroll capture (ms)
sampling.input'last' | 'all''all'last records only the final input value, all records every keystroke

Methods (web)

The web SDK exposes a short public surface . three functions via the window.Galacha global (or the @galacha/sdk module if you import it directly).

MethodSignaturePurpose
Galacha.init(config) => voidInitialize the SDK. Idempotent
Galacha.identify(userId, traits?) => voidAttach a user identity to the current + future sessions
Galacha.stop() => voidStop recording and flush the buffer

There is no Galacha.track() or Galacha.flush() on web. Custom events and manual flushes are React Native features only.


React Native . Galacha.init(config)

Core

OptionTypeDefaultDescription
projectKeystringrequiredLong hex token from the project page
apiUrlstringhttps://api.galacha.meAPI endpoint
identifierstringShorthand for calling identify() after init
traitsobjectUser traits to attach alongside identifier

Capture toggles

OptionTypeDefaultDescription
captureTouchesbooleantrueCapture tap / swipe events (Android)
captureNetworkbooleantrueCapture fetch / XHR
captureErrorsbooleantrueAuto-capture unhandled errors + native crashes
captureScreenbooleantrueCapture screen frames

Privacy

OptionTypeDefaultDescription
maskTextInputsbooleantrueMask <TextInput> values in frames

Screen capture tuning

OptionTypeDefaultDescription
screenCaptureFpsnumber1Frames per second (valid range: 1–4)
screenCaptureQualitynumber0.4JPEG quality (0.1–1.0)
screenCaptureScalenumber0.35Downscale factor (0.25–1.0)
captureMode'pixel' | 'semantic''semantic'pixel = raw frames. semantic = native view-tree serialization

Buffering

OptionTypeDefaultDescription
flushIntervalMsnumber5000How often the event buffer flushes
flushMaxEventsnumber50Flush sooner if the buffer grows past this
sessionTimeoutMsnumber1800000Idle ms before a new session starts

Methods (React Native)

Default export Galacha from @galacha/react-native.

MethodSignaturePurpose
Galacha.init(config) => voidInitialize the SDK. Idempotent
Galacha.identify(userId, traits?) => voidAttach user identity
Galacha.track(name, props?) => voidEmit a custom event into the session timeline
Galacha.screen(name, props?) => voidLog a manual screen-view event
Galacha.flush() => voidForce-flush the buffer to the API now
Galacha.stop() => voidStop recording and tear down listeners
Galacha.setPrivacyMode(on: boolean) => voidToggle full-privacy mode (mask every frame)
Galacha.getSessionId() => string | nullCurrent session ID
Galacha.getVisitorId() => stringPersistent anonymous visitor ID
Galacha.isReady() => booleantrue after init() completes
Galacha.getBuffer() => EventBuffer | nullEvent buffer, passed to <TouchCaptureView>

Named exports:

ExportPurpose
TouchCaptureViewRequired wrapper component around your app for touch capture
GalachaPrivateComponent that masks its children in screen captures

Env var conventions

FrameworkVariable
Next.jsNEXT_PUBLIC_GALACHA_PROJECT_KEY
ViteVITE_GALACHA_PROJECT_KEY
ExpoEXPO_PUBLIC_GALACHA_PROJECT_KEY
CRAREACT_APP_GALACHA_PROJECT_KEY