Full privacy mode

Temporarily mask every frame of the replay. Useful for sensitive screens where even the layout shouldn't leak.

Only available on React Native. Web uses <PrivateBlock> for scoped masking instead.

API

import Galacha from "@galacha/react-native";
 
Galacha.setPrivacyMode(true);   // turn on
Galacha.setPrivacyMode(false);  // turn off

When on, every captured frame is replaced with a solid gray fill. Touch events still fire, network / errors / custom events still flow — only pixels are redacted.

Typical pattern — mount/unmount effect

import { useEffect } from "react";
import Galacha from "@galacha/react-native";
 
function CheckoutScreen() {
  useEffect(() => {
    Galacha.setPrivacyMode(true);
    return () => Galacha.setPrivacyMode(false);
  }, []);
 
  return <CheckoutForm />;
}

The cleanup turns masking off when the user leaves the screen. If the user crashes out of the screen, the next session still starts with masking off (the flag lives in SDK memory, not persisted).

Routing-based

With React Navigation, toggle on focus:

import { useFocusEffect } from "@react-navigation/native";
import { useCallback } from "react";
import Galacha from "@galacha/react-native";
 
function Checkout() {
  useFocusEffect(
    useCallback(() => {
      Galacha.setPrivacyMode(true);
      return () => Galacha.setPrivacyMode(false);
    }, []),
  );
  return <CheckoutForm />;
}

When to use full mode vs <GalachaPrivate>

NeedUse
Hide a single form<GalachaPrivate>
Hide the entire screensetPrivacyMode(true)
Hide a multi-screen flow (checkout → confirmation → receipt)setPrivacyMode on entry, off on exit
Hide dynamic content that can't be wrappedsetPrivacyMode

What's still captured

Even with full privacy mode on:

  • Touch positions (but not which element was touched)
  • Network requests (status, timing, URL — not body)
  • Console logs
  • JS errors
  • Navigation events
  • Custom events emitted via Galacha.track()

Only the frame pixels are masked. Everything else continues recording.

Is it persistent?

No. setPrivacyMode(true) is in-memory only. A page reload or app relaunch resets it to off (the default). Toggle it every time the user enters a sensitive screen.

Related