@facundocalle/witness-react-native
v0.0.1
Published
Witness React Native SDK
Maintainers
Readme
Witness React Native SDK
Paquete React Native sobre el core compartido de Witness.
Uso
import { AppState } from "react-native";
import {
init,
captureException,
createNavigationTracker,
} from "@witness/react-native";
const witness = init({
endpoint: "http://localhost:3001",
projectSlug: "mobile-app",
apiKey: "witness_write_key",
environment: "production",
appVersion: "1.0.0",
buildNumber: "42",
appState: AppState,
});
export const onNavigationStateChange = createNavigationTracker();
try {
throw new Error("Payment failed");
} catch (error) {
await captureException(error);
await witness.flush();
}Alcance actual
- Crea sesiones React Native con
sessionIdestable. - Emite eventos de sesion para inicio, foreground, background y cierre.
- Mantiene journal circular en memoria.
- Hace flush por intervalo y al pasar a background.
- Expone collector de navegacion compatible con estados tipo React Navigation.
