Usage Overview
For developers
Where every event is emitted across the example app and shared providers. Pair this with the Event Reference.
Event usage map in this repository
App-level (Expo Event Playground)
example/src/App.tsx is the running example entry (example/index.js registers it). It:
- constructs
InitializewithSEGMENTIFY_CONFIGURATIONand callstriggerInitialPageView('Home')on mount - uses one
Eventsinstance (SegmentifyEvents) for almost all demo calls, plus staticEvents.subscribePushNotification/Events.pushNotificationInteractionfor push (same class, no instance required) - renders a scrollable Event Playground: one button per demo event, plus an Event Inspector (payload, normalized HTTP response,
userId,sessionId, copy-to-clipboard) - before each demo send, calls
getOrSetUserSessionId()so the inspector always reflects the IDs used for that request - outside Expo Go (
Constants.appOwnership !== 'expo'), bootsPushServicefor permission, listeners, and in-app push state; Push Subscribe uses the staticEvents.subscribePushNotification(seePush Notification Events)
Playground buttons map to SDK methods as follows (each links to the relevant event reference section). For exact demo objects (search, interaction, basket, identity, push), see Search, Interaction, Form and Custom — section Event Playground.
| Playground label | SDK call | Event reference |
|---|---|---|
| PageView | PageView | Page and Product |
| Interaction Click / View | Interaction | Search, Interaction, Form and Custom |
| ProductView | ProductView | Page and Product |
| Before Search, After Search, Searchandising | Search | Search, Interaction, Form and Custom |
| Before / After / Searchandising interaction rows | Interaction | Search, Interaction, Form and Custom |
| Basket View / Add / Remove, Order Success, BasketClear | BasketView, BasketAdd, BasketRemove, Purchase, BasketClear | Checkout and Basket |
| FavoriteAdd / Remove / View | FavoriteAdd, FavoriteRemove, FavoriteView | User and Wishlist |
| Identify, Register, LogIn (button) / Logout | Identify, Register, Login, Logout | User and Wishlist |
| User Traits, [CDP] Identify / Register / Login / Logout User | UserTraits, IdentifyUser, RegisterUser, LoginUser, LogoutUser | Customer Data Platform |
| [CDP] Email / WhatsApp / SMS / Call Subscribe and Unsubscribe | SubscribeUser, UnsubscribeUser | Customer Data Platform |
| Email User OP, Email Interaction Click, SMS Interaction Click | Interaction (cross-channel / campaign shapes) | Search, Interaction, Form and Custom |
| Push Subscribe | Events.subscribePushNotification | Push Notification Events |
| Push Interaction VIEW / CLICK | Events.pushNotificationInteraction | Push Notification Events |
The LogIn playground button calls the SDK method Login (sign-in USER_OPERATIONS step), not a separate LogIn symbol.
Playground buttons (order in App.tsx)
PageView → Interaction Click → Interaction View → ProductView → Before Search → Before Search Interaction Click → Before Search Interaction View → Before Search Interaction Impression → After Search → After Search Interaction Click → After Search Interaction View → AfterSearch Interaction Impression → Searchandising → Searchandising Click → Basket View → Basket Add → Order Success → Basket Remove → BasketClear → FavoriteAdd → FavoriteRemove → FavoriteView → Identify → Register → LogIn → Logout → User Traits → [CDP] Identify User → [CDP] Register User → [CDP] Login User → [CDP] Logout User → [CDP] Email Subscribe → [CDP] WhatsApp Subscribe → [CDP] SMS Subscribe → [CDP] Call Subscribe → [CDP] Email Unsubscribe → [CDP] WhatsApp Unsubscribe → [CDP] SMS Unsubscribe → [CDP] Call Unsubscribe → Push Subscribe → Push Interaction VIEW → Push Interaction CLICK → Email User OP → Email Interaction Click → SMS Interaction Click.
The label AfterSearch Interaction Impression is copied verbatim from App.tsx (no space after “After”); you may rename it locally for clarity.
In Expo Go, Firebase push is not initialized; use a dev client or release build to exercise Push Subscribe and live notifications. PushService still documents receive/open hooks that emit push VIEW / CLICK in a full native setup.
Screen-level (reference UI, not the default entry)
Under example/src/screens/, components illustrate production-style screen wiring (e.g. ProductView on product open). They are useful patterns when you replace the playground with real navigation; see Screen Flows.
Shared-hook-level
shared/hooks/useCart.tsx—BasketAdd,BasketRemove,BasketClearshared/hooks/useWishlist.tsx—FavoriteAdd,FavoriteRemoveshared/hooks/useAuth.tsx—Logout
Push-service-level
example/src/services/PushService.ts— permission, token, retries, receive/open listeners; callsEvents.pushNotificationInteractionforVIEW/CLICKwhere configured
For step-by-step walkthroughs, continue with Screen Flows and Shared Hooks.