BegynnOnboarding
The main component for embedding Begynn onboarding flows.
Import
import { BegynnOnboarding } from "@begynn/react-native";Basic Usage
<BegynnOnboarding
placementId="your-placement-id"
onComplete={(event) => {
console.log("Completed!", event.payload);
}}
/>How It Works
BegynnOnboarding renders a WebView that loads your onboarding flow from Begynn’s servers. The component:
- Generates (or retrieves) a persistent user ID via AsyncStorage
- Loads the onboarding content for your placement
- Handles communication between the WebView and your React Native app
- Dispatches events as users interact with the onboarding
Props Overview
| Prop | Type | Required | Description |
|---|---|---|---|
placementId | string | Yes | Placement ID from Begynn dashboard |
isPreview | boolean | No | Enable preview mode |
baseUrl | string | No | Custom base URL |
containerStyle | ViewStyle | No | Container styling |
webViewProps | WebViewProps | No | WebView customization |
renderLoading | () => ReactElement | No | Custom loading component |
debug | boolean | No | Enable debug logging |
See Props for detailed documentation.
Event Handlers
| Handler | Event Type | Description |
|---|---|---|
onReady | ReadyEvent | Onboarding loaded |
onStart | OnboardingStartEvent | User started |
onComplete | OnboardingCompleteEvent | User completed |
onExit | OnboardingExitEvent | User exited early |
onScreenView | ScreenViewEvent | Screen displayed |
onScreenLeave | ScreenLeaveEvent | Left screen |
onNavigationBack | NavigationBackEvent | Navigated back |
onButtonClick | ButtonClickEvent | Button clicked |
onChoiceSelect | ChoiceSelectEvent | Choice selected |
onChoiceDeselect | ChoiceDeselectEvent | Choice deselected |
onEvent | SDKEvent | All events |
onError | Error | Error occurred |
See Events for detailed documentation.
Last updated on