
Client SDK for a remote feature/voting API offering networked feature listing, anonymous or signed user identities with persistent token storage, server‑signed HMAC authentication, and suspendable APIs for UI integration.
Kotlin Multiplatform SDK for HeedKit — shared Android/iOS/JVM client (Ktor under the hood).
Targets: androidTarget, iosX64, iosArm64, iosSimulatorArm64, jvm.
import com.heedkit.kmp.HeedKit
suspend fun bootstrap() {
// Anonymous. Register an IdentityTokenStore (platform KV: SharedPreferences /
// NSUserDefaults / a file) so the server-issued identity token persists and the
// same visitor keeps their votes across launches:
// HeedKit.setIdentityStore(MyPlatformIdentityStore())
HeedKit.initialize(
workspaceKey = "fk_xxx",
apiUrl = "https://heedkit.com",
)
val features = HeedKit.list()
}
apiUrl: pass your HeedKit origin only (no/sdksuffix) — the SDK appends/sdk/...itself, sohttps://heedkit.com/sdkdouble-stacks the path and 404s. The default (https://api.heedkit.com) doesn't currently serve the API, so always set it.
A named identity must be signed by your backend — the API rejects any externalId
without a valid userHash (401 invalid_user_signature). Expose an authenticated
endpoint returning { externalId, userHash, name, email } where
userHash = lowercase_hex(HMAC_SHA256(serverSecret, externalId)), fetch it in the app,
then:
HeedKit.initialize(
workspaceKey = "fk_xxx",
apiUrl = "https://heedkit.com",
user = EndUser(externalId = me.externalId, email = me.email, userHash = me.userHash),
)Never embed the server secret in the app — binaries are trivially unpacked.
UI: bring your own — this module exposes pure-Kotlin data + suspend functions. Use it from your shared business layer; render with Jetpack Compose (Android) or SwiftUI (iOS).
Kotlin Multiplatform SDK for HeedKit — shared Android/iOS/JVM client (Ktor under the hood).
Targets: androidTarget, iosX64, iosArm64, iosSimulatorArm64, jvm.
import com.heedkit.kmp.HeedKit
suspend fun bootstrap() {
// Anonymous. Register an IdentityTokenStore (platform KV: SharedPreferences /
// NSUserDefaults / a file) so the server-issued identity token persists and the
// same visitor keeps their votes across launches:
// HeedKit.setIdentityStore(MyPlatformIdentityStore())
HeedKit.initialize(
workspaceKey = "fk_xxx",
apiUrl = "https://heedkit.com",
)
val features = HeedKit.list()
}
apiUrl: pass your HeedKit origin only (no/sdksuffix) — the SDK appends/sdk/...itself, sohttps://heedkit.com/sdkdouble-stacks the path and 404s. The default (https://api.heedkit.com) doesn't currently serve the API, so always set it.
A named identity must be signed by your backend — the API rejects any externalId
without a valid userHash (401 invalid_user_signature). Expose an authenticated
endpoint returning { externalId, userHash, name, email } where
userHash = lowercase_hex(HMAC_SHA256(serverSecret, externalId)), fetch it in the app,
then:
HeedKit.initialize(
workspaceKey = "fk_xxx",
apiUrl = "https://heedkit.com",
user = EndUser(externalId = me.externalId, email = me.email, userHash = me.userHash),
)Never embed the server secret in the app — binaries are trivially unpacked.
UI: bring your own — this module exposes pure-Kotlin data + suspend functions. Use it from your shared business layer; render with Jetpack Compose (Android) or SwiftUI (iOS).