Install with Expo
Set up OnboardingYak in an Expo-managed or Expo development-build project.
Requirements#
Use a React Native 0.73 or later Expo project. The SDK depends on AsyncStorage for cached flows, saved onboarding progress, and stable experiment assignment, plus safe-area context for device insets.
Install the SDK#
npx expo install @onboarding-yak/react-native @react-native-async-storage/async-storage react-native-safe-area-contextThen install feature-specific modules as needed. Common examples:
npx expo install expo-haptics expo-video expo-camera expo-locationOnly include modules your flow and application use. For the app-specific command, open Studio → your app → App settings → SDK connection.
Create or rebuild a development client#
After adding or changing a native dependency, rebuild the native app. Restarting Metro alone does not include a new native module in an installed binary.
npx expo run:iosnpx expo run:androidIf you use EAS Build, create a new development build and install it on the device.
Initialize#
Render the component inside your app’s navigation tree. Pass your studio app’s ID, publishable key, and the correct baseUrl. Keep a valid fallback flow in the bundle.
import { Onboarding } from '@onboarding-yak/react-native';
import { fallbackFlow } from './fallback-flow';
export function OnboardingScreen() {
return (
<Onboarding
flowId="YOUR_APP_ID"
apiKey="oy_pub_YOUR_PUBLISHABLE_KEY"
baseUrl="https://onboardingyak.com"
fallbackFlow={fallbackFlow}
onComplete={(answers, { variables }) => {
// Continue into your app and save any answers you need.
}}
/>
);
}