Skip to main content

SDK Overview

The Break Ground Runtime SDK is a client-side JavaScript library that runs inside your web application. It fetches published content from the BreakGround API, evaluates targeting rules locally, renders UI overlays, and tracks user interactions for analytics.

What the SDK Does

  • Fetches content — On initialization, the SDK retrieves the latest published flows, tooltips, surveys, and other content from the BreakGround API.
  • Evaluates targeting rules — Audience segmentation rules (URL patterns, user properties, device type) are evaluated client-side to determine which content to display.
  • Renders UI overlays — The SDK injects tooltips, modals, beacons, and step-by-step flow guides on top of your application's existing UI without modifying your DOM structure.
  • Tracks events — User interactions (page views, clicks, flow step completions, survey responses) are captured automatically.
  • Batches analytics — Events are batched and sent to the API in intervals to minimize network overhead and avoid impacting application performance.

Architecture

The SDK is delivered as an IIFE (Immediately Invoked Function Expression) loaded via a <script> tag. It does not require a package manager or build step. Once loaded, it exposes a global DAP function used to send commands.

Browser
|-- DAP SDK (loaded via <script>)
| |-- ConfigManager (company config + feature flags)
| |-- ContentManager (fetches and caches published content)
| |-- FlowRunner (state machine for multi-step flows)
| |-- StepRenderer (renders tooltips, modals, beacons)
| |-- EventTracker (captures page views, clicks, flow events)
| |-- EventBatcher (batches events for network efficiency)
| |-- TargetingEvaluator (client-side audience rule evaluation)
| |-- IdentityManager (user identification and session tracking)
| |-- Translator (locale-aware content rendering)
| |-- VariantAssigner (A/B test variant assignment)
|
|-- BreakGround API (fetches config, content; receives events)

Key Components

ComponentResponsibility
ConfigManagerLoads company configuration and feature flags on init.
ContentManagerFetches, caches, and serves published content (flows, tooltips, surveys).
FlowRunnerDrives multi-step flow execution using a finite state machine.
StepRendererRenders individual steps (tooltips, modals, beacons) and anchors them to target elements.
EventTrackerCaptures user interactions: page views, clicks, scroll depth, rage clicks.
EventBatcherQueues events and flushes them to the API in batches at configurable intervals.
TargetingEvaluatorEvaluates audience segmentation rules client-side to decide which content is shown.
IdentityManagerManages user identification via DAP('identify', ...) and session lifecycle.
TranslatorSelects the correct locale for content rendering based on SDK config or browser language.
VariantAssignerAssigns users to A/B test variants deterministically for experiment support.

For installation instructions, see SDK Installation. For configuration options, see SDK Configuration.