Frontend IntegrationWeb ObjectData and auth flows

Data and auth flows

Overview of the event pipeline, auth flow, and session lifecycle for the Sophi Web Object SDK.

Event pipeline

Loading diagram…
  1. Your code sets a tracked property on window.sophi_object or calls SophiTracker.push.
  2. The SDK applies the update, then prepares one or more events from the current data layer state.
  3. Each event includes a page context, the resolved event_type, and any relevant objects (user, product, etc.). Invalid or incomplete data is skipped with a console warning.
  4. Events wait briefly (debounceMs) so rapid updates can batch; failed deliveries are retried with exponential backoff up to maxRetries.
  5. Delivery uses the active session established at startup: payloads are sent to Sophi over HTTPS as JSON.

When the visitor hides or leaves the tab, the SDK attempts a best-effort flush (for example via the browser’s unload / beacon mechanisms) so late events are less likely to be lost.

Auth and session

Loading diagram…
  • Session creation is deduplicated while a request is already in flight.
  • On logout or user switch, session state and cookies are cleared so the next activity uses a fresh session.
  • When an anonymous visitor logs in, the SDK coordinates with Sophi so the existing anonymous activity can be linked to your config.userId where applicable.

After login in your app, call SophiTracker.updateUser(externalId) then push user / other context as needed. See SophiTracker API.

On this page