API Reference
API Reference
Section titled “API Reference”This page summarizes the public entry points visible in the shared Kotlin code.
Primary SDK class
Section titled “Primary SDK class”DeepdotsPopups
Section titled “DeepdotsPopups”Main responsibilities:
- initialize SDK runtime
- load popup definitions
- attach a platform context
- evaluate triggers and queue popups
- render popup and survey experiences
- emit popup lifecycle events
Key methods
Section titled “Key methods”Initialization
Section titled “Initialization”init(options: InitOptions)initialize(options: InitOptions)autoLaunch()attachContext(context: PlatformContext)
Navigation and triggers
Section titled “Navigation and triggers”setPath(path: String?)onScroll(percentage: Int)onExit()triggerEvent(eventName: String)triggerClick(targetId: String)
Display
Section titled “Display”show(options: ShowOptions, context: PlatformContext)showByPopupId(popupId: String, context: PlatformContext)triggerSurvey(surveyId: String, context: PlatformContext, popupId: String? = null)
Events
Section titled “Events”on(event: Event, listener: (EventData) -> Unit)off(event: Event, listener: (EventData) -> Unit)
Analytics and identity
Section titled “Analytics and identity”track(name: String, params: Map<String, Any?>? = null)setUserAttributes(attributes: Map<String, Any?>)— dimensions to break reports down by. Held in memory only, so set them again after everyinit().setMetric(key: String, value: Any?)— measurable values, sent in the dedicatedfeedback.metricsfield of the payload. Re-sent on every flush and held in memory only, like the attributes above.suspend setContactAttributes(attributes: Map<String, Any?>): BooleansetUserId(userId: String? = null)setTrackingEnabled(enabled: Boolean)endSession()enterMiniService(name: String, entryPointType: String? = null)/exitMiniService(name: String)
See Analytics for what each one records.
Diagnostics
Section titled “Diagnostics”environment: Environment— read-only, reflects the backend the SDK is pointed at afterinit()(defaults toEnvironment.Production). Useful for asserting at runtime which backend a givenpublicKeyis hitting.
Convenience helpers
Section titled “Convenience helpers”Deepdots
Section titled “Deepdots”The Deepdots object provides utility helpers:
create()createInitialized(options)now()parseHtml(html)dismiss(context)getSurveyHtml(surveyId, productId)createInitializedSimple(...)
Platform-specific helpers
Section titled “Platform-specific helpers”The repository also provides scroll binding helpers on Android:
bindRecyclerView(recyclerView: RecyclerView)bindScrollView(scrollView: ScrollView)
These help translate host scrolling into onScroll(...) updates for trigger evaluation.