Screen Flows
For developers
A screen-by-screen walkthrough of where events fire in the example app, with links into the matching reference pages.
Event Playground (example/src/App.tsx)
The shipped example app is a single-screen Segmentify Expo Event Playground (not a tab/stack navigator).
Startup
Initializeis constructed withSEGMENTIFY_CONFIGURATIONfrom@shared/segmentify-configuration.- On mount,
triggerInitialPageView('Home')runs insidetry/catch(warnings respectloggerOptions.debugMode). - Expo Go: push setup returns early; Firebase-dependent flows are skipped.
- Native / dev client:
PushServicerequests permission, registers listeners, and updates UI state; seePush Notification Events.
Sending demo events
Each button runs an async action: resolve userId / sessionId via getOrSetUserSessionId(), invoke the SDK method, then show payload and response in the inspector (Response objects are normalized to { ok, status, statusText, body }).
Search-related playground rows cover instant (before/after query), faceted searchandising, and interaction shapes for before-search widgets, search results, and faceted widgets—mirroring common web tracker patterns in one place. Payload literals match Search, Interaction, Form and Custom (section Event Playground).
The last three buttons exercise cross-channel Interaction payloads: Email User OP (type: 'sgm-hash' with step, channel, identity), Email Interaction Click (type: 'email'), and SMS Interaction Click (type: 'sms'). Use these as QA templates alongside server-side campaign configuration.
Reference: Event Overview, Search, Interaction, Form and Custom, Push Notification Events.
Product detail (example/src/screens/ProductScreen.tsx)
Trigger
User opens a product detail screen.
Event
events.ProductView({...})
Why
Marks viewed product for recommendation and conversion analytics.
Reference: Page and Product Events.
Basket page (example/src/screens/BasketScreen.tsx)
Trigger
Cart screen rendered with non-empty cart.
Event
events.BasketView({...})
Why
Creates checkout funnel cart-view step.
Reference: Checkout and Basket Events.
Checkout success (example/src/screens/CheckoutSuccessScreen.tsx)
Trigger
After checkout route loads with order params.
Event
events.Purchase({...})
Why
Confirms conversion and revenue attribution.
Reference: Checkout and Basket Events.
Register (example/src/screens/RegisterScreen.tsx)
Trigger
Form validates and registration action succeeds.
Event
events.Register({...})
Why
Identifies new registered users and enables user-based messaging.
Reference: User and Wishlist Events.
Edit profile (example/src/screens/EditProfileScreen.tsx)
Trigger
User saves email/phone/permission preferences.
Event
events.Identify({...})
Why
Keeps profile and communication permissions synchronized.
Reference: User and Wishlist Events.
Wishlist screen (example/src/screens/WishlistScreen.tsx)
Trigger
Wishlist screen loads or wishlist items change.
Event
events.FavoriteView({ favoritesList })
Why
Sends current favorite-product context for targeting.
Reference: User and Wishlist Events.
Reference screen components use useEffect for ProductView, BasketView, and Purchase, but dependencies are intentionally narrow—retest when you add fields to dependency arrays so you do not double-send on unrelated state churn. The Event Playground only fires on button press, which is the safest pattern for QA.