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, in Xcode choose File > Packages > Update to Latest Package Versions (see the version history).
- Add the following package: https://github.com/KlipFit/kleep-spm
- Change dependency rule to: up to next major version
Permissions
Add the following permission to your project on info.plist: NSCameraUsageDescription
Usage
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
Method 2: loadView
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.
Implementation example
KlipftNavigationController the way you like: SwiftUI .sheet, or .pageSheet, .fullScreen or .overFullScreen in UIKit, including on top of another modal. The size guide stays inside the safe area and draws its own navigation bar (back and close): there is nothing to hide or configure. Requires SDK 4.3.0 or later.
The SDK currently supports 6 UI languages, passed as language: KleepLanguageCode:
Supported languages (6)
Supported languages (6)
fr— French (default)en— Englishes— Spanishit— Italianpt— Portuguesenl— Dutch
Method 3: track
This method allows to track custom 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.
