Skip to content

API Reference

This page summarizes the public entry points visible in the shared Kotlin code.

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
  • init(options: InitOptions)
  • initialize(options: InitOptions)
  • autoLaunch()
  • attachContext(context: PlatformContext)
  • setPath(path: String?)
  • onScroll(percentage: Int)
  • onExit()
  • triggerEvent(eventName: String)
  • triggerClick(targetId: String)
  • show(options: ShowOptions, context: PlatformContext)
  • showByPopupId(popupId: String, context: PlatformContext)
  • triggerSurvey(surveyId: String, context: PlatformContext, popupId: String? = null)
  • on(event: Event, listener: (EventData) -> Unit)
  • off(event: Event, listener: (EventData) -> Unit)
  • 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 every init().
  • setMetric(key: String, value: Any?) — measurable values, sent in the dedicated feedback.metrics field of the payload. Re-sent on every flush and held in memory only, like the attributes above.
  • suspend setContactAttributes(attributes: Map<String, Any?>): Boolean
  • setUserId(userId: String? = null)
  • setTrackingEnabled(enabled: Boolean)
  • endSession()
  • enterMiniService(name: String, entryPointType: String? = null) / exitMiniService(name: String)

See Analytics for what each one records.

  • environment: Environment — read-only, reflects the backend the SDK is pointed at after init() (defaults to Environment.Production). Useful for asserting at runtime which backend a given publicKey is hitting.

The Deepdots object provides utility helpers:

  • create()
  • createInitialized(options)
  • now()
  • parseHtml(html)
  • dismiss(context)
  • getSurveyHtml(surveyId, productId)
  • createInitializedSimple(...)

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.