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
| Option | Type | Default | Description |
|---|
projectKey | string | required | Long hex token from the project page in the dashboard |
apiUrl | string | https://api.galacha.me | API endpoint |
identifier | string | — | Shorthand for calling identify() right after init() |
traits | object | — | User traits to attach alongside identifier |
Capture toggles
| Option | Type | Default | Description |
|---|
captureNetwork | boolean | true | Capture fetch and XHR |
captureErrors | boolean | true | Auto-capture unhandled errors |
captureConsole | boolean | true | Capture console.log/warn/error |
Privacy
| Option | Type | Default | Description |
|---|
maskInputs | boolean | true | Mask all <input> / <textarea> values |
Buffering
| Option | Type | Default | Description |
|---|
flushIntervalMs | number | 5000 | How often the event buffer flushes to the API |
flushMaxEvents | number | 50 | Flush sooner if the buffer grows past this |
sessionTimeoutMs | number | 1800000 | Idle ms before a new session starts. Default 30 min |
Sampling (rrweb)
| Option | Type | Default | Description |
|---|
sampling.mousemove | number | false | — | Throttle mousemove capture (ms), or disable with false |
sampling.scroll | number | — | Throttle 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).
| Method | Signature | Purpose |
|---|
Galacha.init | (config) => void | Initialize the SDK. Idempotent |
Galacha.identify | (userId, traits?) => void | Attach a user identity to the current + future sessions |
Galacha.stop | () => void | Stop 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
| Option | Type | Default | Description |
|---|
projectKey | string | required | Long hex token from the project page |
apiUrl | string | https://api.galacha.me | API endpoint |
identifier | string | — | Shorthand for calling identify() after init |
traits | object | — | User traits to attach alongside identifier |
Capture toggles
| Option | Type | Default | Description |
|---|
captureTouches | boolean | true | Capture tap / swipe events (Android) |
captureNetwork | boolean | true | Capture fetch / XHR |
captureErrors | boolean | true | Auto-capture unhandled errors + native crashes |
captureScreen | boolean | true | Capture screen frames |
Privacy
| Option | Type | Default | Description |
|---|
maskTextInputs | boolean | true | Mask <TextInput> values in frames |
Screen capture tuning
| Option | Type | Default | Description |
|---|
screenCaptureFps | number | 1 | Frames per second (valid range: 1–4) |
screenCaptureQuality | number | 0.4 | JPEG quality (0.1–1.0) |
screenCaptureScale | number | 0.35 | Downscale factor (0.25–1.0) |
captureMode | 'pixel' | 'semantic' | 'semantic' | pixel = raw frames. semantic = native view-tree serialization |
Buffering
| Option | Type | Default | Description |
|---|
flushIntervalMs | number | 5000 | How often the event buffer flushes |
flushMaxEvents | number | 50 | Flush sooner if the buffer grows past this |
sessionTimeoutMs | number | 1800000 | Idle ms before a new session starts |
Methods (React Native)
Default export Galacha from @galacha/react-native.
| Method | Signature | Purpose |
|---|
Galacha.init | (config) => void | Initialize the SDK. Idempotent |
Galacha.identify | (userId, traits?) => void | Attach user identity |
Galacha.track | (name, props?) => void | Emit a custom event into the session timeline |
Galacha.screen | (name, props?) => void | Log a manual screen-view event |
Galacha.flush | () => void | Force-flush the buffer to the API now |
Galacha.stop | () => void | Stop recording and tear down listeners |
Galacha.setPrivacyMode | (on: boolean) => void | Toggle full-privacy mode (mask every frame) |
Galacha.getSessionId | () => string | null | Current session ID |
Galacha.getVisitorId | () => string | Persistent anonymous visitor ID |
Galacha.isReady | () => boolean | true after init() completes |
Galacha.getBuffer | () => EventBuffer | null | Event buffer, passed to <TouchCaptureView> |
Named exports:
| Export | Purpose |
|---|
TouchCaptureView | Required wrapper component around your app for touch capture |
GalachaPrivate | Component that masks its children in screen captures |
Env var conventions
| Framework | Variable |
|---|
| Next.js | NEXT_PUBLIC_GALACHA_PROJECT_KEY |
| Vite | VITE_GALACHA_PROJECT_KEY |
| Expo | EXPO_PUBLIC_GALACHA_PROJECT_KEY |
| CRA | REACT_APP_GALACHA_PROJECT_KEY |