Skip to main content
A thin WebView wrapper around drawer.kleep.ai. The SDK exposes one component + two methods, mirroring the iOS surface.

Installation


Each release is published as an npm tarball on cdn.kleep.ai. Two URL shapes are available: Latest stable (auto-updates with every new stable release — pre-releases never move this pointer):
Pin a specific version (recommended for production — fully immutable):
Replace v1.0.0 and 1.0.0 with the desired release tag. The two listed packages are peer dependencies — the SDK requires them but lets you control the version. The published tarball includes a SHA-256 alongside (<tarball>.sha256 / latest.tgz.sha256) if you want to verify integrity before installing.

Expo

Both peer deps are pre-bundled in Expo Go (SDK 54+). No extra setup needed in dev. For production builds, expo prebuild picks them up automatically.

Bare React Native

Permissions


For the footwear flow (camera scan), add to ios/<App>/Info.plist:
And to android/app/src/main/AndroidManifest.xml:

Configure once at app boot


The SDK currently supports 24 UI languages:
  • fr — French (default)
  • en — English
  • de — German
  • it — Italian
  • es — Spanish
  • nl — Dutch
  • pt — Portuguese
  • ja — Japanese
  • ko — Korean
  • pl — Polish
  • br — Brazilian Portuguese
  • dk — Danish
  • fi — Finnish
  • se — Swedish
  • gb — British English
  • id — Indonesian
  • ru — Russian
  • th — Thai
  • vi — Vietnamese
  • ar — Arabic
  • zh — Chinese (Simplified)
  • zht — Chinese (Traditional)
  • el — Greek
  • hu — Hungarian
If a language you need isn’t in the list, contact your Kleep representative.

Usage


Method 1: Kleep.checkProduct

Call this on PDP mount. The result drives the “Find my size” CTA — whether to render it, and what label to show. Returns
Logic schema The SDK caches the result for 5 min in memory, keyed on (publicId, productId) for the gate and (publicId, productId, mid) for the recommended size. Re-rendering the PDP or navigating back is free. Implementation example

Method 2: <KleepFindSizeView>

Mount this component to open the size-finder drawer in a fullscreen Modal+WebView. Controlled-component pattern: you own the visible state, the SDK requests close via onDismiss. Auto-wired by the SDK (you don’t need to do anything):
  • Bridges the drawer’s iframe-style window.parent.postMessage to the React Native bridge
  • Persists mid / uid to AsyncStorage when the drawer pushes them
  • Responds to getMid / getUid / getSizes postMessages from the drawer
  • Calls Kleep.checkProduct on open to resolve the flow (clothing / lingerie / footwear / children) — uses the same 5-min cache as your CTA call, so it’s free if you’ve already invoked checkProduct

Method 3: Kleep.track

Fire-and-forget analytics. Never throws.
We want to track 3 events: product_viewed example
product_added_to_cart example
checkout_completed 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’s Android and iOS SDKs. PostHog is embedded inside @kleep/react-native — you don’t need to install 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.

Cache invalidation


The SDK keeps two in-memory caches (5 min TTL each):
  • Product gate — (publicId, productId) → { recommendable, category, productFound }
  • Recommended size — (publicId, productId, mid) → size label
Both invalidate automatically. If you need to force-refresh (user logged out, retailer switched, manual refresh button):