Event Overview
For developers
The map of all event families and how runtime payloads are built. For the business meaning of each family, see the Event Catalog (Plain Language).
Event families in this SDK
src/classes/events.ts defines these runtime event families:
PAGE_VIEWPRODUCT_VIEWSEARCHCHECKOUT(view-basket,purchase,customer-info,payment-info)BASKET_OPERATIONS(add,remove,clear)WISHLIST(add,remove,detail,view-favorites)USER_OPERATIONS(update,iyspermissions,signup,signin,signout)USER_TRAITS(UserTraits)USER_IDENTIFY(IdentifyUser)USER_REGISTER/USER_LOGIN/USER_LOGOUT(RegisterUser,LoginUser,LogoutUser)USER_SUBSCRIBE/USER_UNSUBSCRIBE(SubscribeUser,UnsubscribeUser)INTERACTIONFORMCUSTOM_EVENT
Push has dedicated static methods (separate endpoints):
Events.subscribePushNotification()Events.pushNotificationInteraction()
Payload lifecycle in sendEvent()
Every call to events.sendEvent(payload) is enriched with values sourced from SDK config and storage:
deviceuserIdsessionIdcurrencylangososversiontestModeemail(if a user object exists in storage)
Storage keys used during this flow are from src/constants/keys.ts, especially:
SEGMENTIFY_CONFIGSEGMENTIFY_DEVICESEGMENTIFY_USERSEGMENTIFY_USER_IDSEGMENTIFY_USER_PROFILE(CDPIdentifyUserdedup snapshot)SEGMENTIFY_SESSION_IDSEGMENTIFY_EVENT_QUEUE
Queue and replay behavior
nextPage queue
If payload has nextPage: true, SDK does not send network request immediately. It appends payload into SEGMENTIFY_EVENT_QUEUE and returns.
Offline queue
When network is offline, offlineEventLogic() attempts to append payload into the same queue.
Online replay
When network is online, onlineEventLogic() replays queued events through sendEvent() and clears queue afterward.
Naming pattern
A payload usually includes:
name: event family (required)step: sub-action for some families- event-specific fields (
productId,totalPrice, etc.)
Type source of truth vs runtime source of truth
- Type contracts:
src/types.ts - Runtime behavior:
src/classes/events.ts
Use both together. Type definitions define the integration contract, while runtime code defines enrichment and transport behavior.
Known runtime examples
ProductViewstringifies eachparamsvalue before send.Interactionmay copyinstanceIdintointeractionId.PurchaserequiresorderNoby type and the example app now usesorderNoin checkout success flow.
See Known Gotchas for complete mismatch list.
Start here if you are new
- Read
SDK Events Explainedfor a plain-language, method-by-method walkthrough.