Quick start: React Native
Use the React Native wrapper with AsyncStorage persistence, AppState-driven sessions and hooks.
The React Native package re-exports the TypeScript core and adds AsyncStorage persistence, AppState session handling and React hooks. Source: sdks/react-native. It has been type-checked against stub types but not yet run on a device in CI.
App.tsx
import AsyncStorage from "@react-native-async-storage/async-storage";
import { initReactNative, useParam, useExperience } from "@aop/sdk-react-native";
const aop = initReactNative({
projectKey: "pk_…",
endpoint: "https://api.your-domain.com",
asyncStorage: AsyncStorage,
});
export function Onboarding() {
const steps = useParam("onboarding_steps", 4);
const flow = useExperience<{ steps: { component: string; headline: string }[] }>("onboarding");
// render flow?.steps ?? defaultSteps.slice(0, steps)
}When the app goes to the background the session ends and the buffer is flushed; on return to the foreground, app_opened is tracked and config refreshed.