References
Events reference
Every subscription returns { remove() }. Call remove() when the listener's owner unmounts.
| Method | Payload |
|---|---|
onEventReceived | { type, data, timestamp } |
onRewardEarned | { id, name, description, imageUrl, value, type, earnedAt } |
onError | { message, code? } |
onSecurityError | { allPassed, checks[] } |
onSSEEffects | { effects[] } — attaching a listener disables the SDK's progress popup |
onDeepLink | { url, scheme?, host?, path?, queryParameters? } |
onWebViewClosed | — |
onThemeChanged | { theme, resolvedTheme } |
onLanguageChanged | { languageTag } |
API reference
| Method | Returns |
|---|---|
KLP.initialize(config) | Promise<boolean> |
KLP.setUser(accessToken) | Promise<boolean> |
KLP.setToken(accessToken, expiryDate?) | Promise<boolean> |
KLP.logout() | Promise<boolean> |
KLP.launch(path?) | Promise<boolean> |
KLP.logEvent(eventName, attributes?) | Promise<boolean> |
KLP.logEncryptedEvent(eventName, attributes?) | Promise<boolean> |
KLP.setTheme(theme) | Promise<boolean> |
KLP.setLanguage(languageTag | null) | Promise<boolean> |
KLP.getAppearance() | Promise<KLPAppearanceSnapshot> |
KLP.isInitialized() | Promise<boolean> |
KLP.isDeviceSecure() | Promise<boolean> |
KLP.performSecurityChecks() | Promise<KLPSecurityCheckResult> |
KLP.openDebugScreen() | Promise<boolean> — Android only |
All TypeScript types (KLPInitializeConfig, KLPTheme, KLPReward, KLPDeepLinkPayload,KLPAppearanceSnapshot, KLPSecurityCheckResult, …) are exported from the package root.
Updated about 1 month ago
Did this page help you?
