Skip to main content
Version history: see Android SDK - Version history for the latest version and the changes in each release.

Installation


This process needs to be followed only once, the first time you need to install the SDK in your project. To update the SDK later, change the version in the dependency (see the version history). The SDK is distributed through a private Cloudsmith Maven repository.
1

Add your Cloudsmith credentials

In your local.properties, add the credentials provided by Kleep:
local.properties
Replace TOKEN_VALUE with the token provided by Kleep. The username is the literal string token.
2

Add the Cloudsmith Maven repository

In your settings.gradle or settings.gradle.kts, add the following lines:
3

Add the dependency

In your module’s build.gradle or build.gradle.kts file, add the following lines to create the dependency:
Replace version with the latest version from the version history, including the leading v: for example com.klipfit:kleep-android:v4.1.9.
These instructions apply to older SDK versions distributed through JitPack.
  1. In your gradle.properties, add this token: authToken=jp_9ibcequhrjtge3cmavt2k4sq6a
  2. In your settings.gradle or settings.gradle.kts, add the following lines:
  3. In your module’s build.gradle or build.gradle.kts file, add the following lines to create the dependency:

Initialization


Edit your custom Application class and provide applicationContext for initialization.
Don’t forget to add your Application class to AndroidManifest.xml

Import


You can manually import the module at the beginning of your MainActivity.kt

Usage


The SDK comes with 3 methods:

Method 1: requestSize

This method allows to implement the logic of the CTA. Logic schema This schema explains how to update the CTA opening Kleep. https://www.figma.com/board/BlurZ01lR3JBQZeTUU98TE/Mobile---CTA-Logic?node-id=0-1&t=ccXWciNziIdfhgew-1 Implementation example
The SDK currently supports 6 UI languages, passed via setLang:
  • fr — French (default)
  • en — English
  • es — Spanish
  • it — Italian
  • pt — Portuguese
  • nl — Dutch
If a language you need isn’t in the list, contact your Kleep representative.

Method 2: show

This method is called when the CTA is clicked. It allows to load the different screens. The developper integrating the SDK should embed them into a bottom sheet.

Method 3: track

This method allows to track custom events.
We want to track 3 events: product_viewed Parameters Example
product_added_to_cart Parameters Example
checkout_completed Parameters Example

A/B testing


Kleep runs experiments on parts of the sizing flow (CTA copy, layout, timing) to keep improving conversion, using the same experimentation layer already used across Kleep’s web integrations, built on PostHog. PostHog is embedded inside the Kleep SDK — you don’t need to add the PostHog SDK yourself, request any extra permission, or call any additional method. Here’s how the variant assignment flows internally: The assignment is keyed on a stable on-device ID, so a given install keeps seeing the same variant for the duration of the experiment instead of being re-rolled on every launch. You don’t read or set the variant yourself — Kleep resolves it internally and reports the conversion delta per variant on its side.