docs(kmp): add the KMP SDK section - #259
Merged
Merged
Conversation
Adds content/docs/kmp for the Superwall KMP SDK (0.1.1, beta), registered under the SDKs group in the root meta.json. Pages are written standalone rather than reusing content/shared, because remark-sdk-filter only matches (ios|android|expo|flutter) — a /kmp/ page would no-op the filter and render every platform's blocks at once. Behavior is verified against the KMP source rather than ported blindly from the Android docs; the notable divergences (library-declared paywall activity, minSdk 26, the isStatic requirement, the SPM bridge, delegate threading) are documented in guides/platform-differences. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A clean-context claim audit against the KMP and superwall-android sources turned up four wrong or incomplete claims, all verified independently before changing anything: - transactionBackgroundView was listed iOS-only. superwall-android has it (PaywallOptions.kt:109,138) and the KMP mapper wires it (OptionsMapper.kt:87-91) — the docs had copied a stale KDoc marker. - shouldShowWebRestorationAlert and shouldShowWebPurchaseConfirmationAlert are genuinely iOS-only and were missing from the "complete list". Neither carries an "iOS only" KDoc marker, which is why they were missed. - handleLog and handleSuperwallEvent were stated as unconditionally background on Android. Logger.log calls handleLog inline before the shouldPrint check, and track() adds no dispatcher hop, so both run on the caller's thread — main included. Now documented as not guaranteed. - subscriptionStatusFlow was said to emit on main. It is a bare MutableStateFlow; a StateFlow delivers on the collector's context. Also documents the manifest-merger conflict that hits apps migrating from the standalone Android SDK, which declares the same activity with a different theme. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Final cleanup pass. The temporary yellow review containers are converted to the proper MDX callout components; the wrapped prose is unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
superwall-docs | e84a039 | Commit Preview URL Branch Preview URL |
Aug 14 2026, 08:02 PM |
Adds the Xcode "Add Package Dependencies" screenshot to the iOS half of the install page — the only purely visual step in the section, and the one most likely to be done wrong. Lives under content/docs/images/kmp/ rather than a per-section images folder, since copy-docs-images.cjs only mirrors content/docs/images/** into public/. The screenshot shows Xcode's default Dependency Rule (Up to Next Major), so a note under it explains why to pin Exact Version while the SDK is in beta: the bridge binary and the Kotlin klib ship from one tag, and SPM drifting ahead of the version the shared module was built against is what breaks the link step. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
# Conflicts: # .claude/launch.json
The 'Getting the right API key' section assumed the reader knew what expect/actual meant and named mechanisms instead of showing one. Rewritten to state the actual situation (two dashboard apps, two keys, one shared call site) and show the expect/actual pattern as code. The install page's version of the same advice now links there instead of repeating it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
content/docs/kmpfor the Superwall KMP SDK (0.1.1, beta), registered under the---SDKs---group in the rootmeta.json. Closes SW-5718.Every page carries a beta warning, per Jake's "put beta in the docs … nothing gets launched till it's documented."
Pre-flight checks
com.superwall.sdk:superwall-kmp:0.1.1returns 200 fromrepo1.maven.org(lastUpdated 20260810130716), with platform artifacts forandroid,iosarm64,iossimulatorarm64,iosx64. Thesearch.maven.orgSolr index returns nothing — index lag only, not a resolution problem. Worth knowing, since a search-based check would have looked like the Web SDK trap repeating.0.1.1SuperwallKMPBridge.xcframework.ziprelease asset (9,963,736 bytes) has SHA-256eec4f35…13e2f, matchingPackage.swift:59and the published.checksumasset exactly.0.1.1annotated tag object (b5c56c4) points at commit8727bcf, which ismain; both0.1.1..mainandmain..0.1.1are empty. These docs describe the 0.1.1 release, which is also HEAD.Structure
Follows the Web SDK precedent: standalone pages, registration limited to the root
meta.json.Pages deliberately do not
<include>content/shared/**.plugins/remark-sdk-filter.ts:14matches only/(ios|android|expo|flutter)/, so on a/kmp/page the filter no-ops and every platform's:::ios/:::androidblock would render at once. Addingkmpto that regex instead would strip the shared pages to near-empty, since no:::kmpblocks exist.Verified against source, not assumed from the Android docs
Ian's "basically one-to-one" held for the API surface but not the integration story. Divergences found and documented:
SuperwallPaywallActivityitself — no manifest edits needed, unlike the Android SDK's install pagesuperwall-kmp/src/androidMain/AndroidManifest.xml;superwall-androidsuperwall/src/main/AndroidManifest.xmldeclares only 3 permissions, no activitiesminSdk26, not the Android SDK's 23gradle/libs.versions.toml:5vssuperwall-androidsuperwall/build.gradle.kts:34Contextparam;Superwall.androidSetup(application)is the escape hatch if the startup provider is strippedandroidMain/.../SuperwallInitializer.kt,androidMain/.../AndroidSetup.kt:37DebugViewActivityisinternalatsuperwall-androiddebug/DebugView.kt:917isStatic = true— compile-only cinterop, so a missing bridge is a link error at app build time, not a runtime failuresuperwall-kmp/build.gradle.kts:75-84usescompilerOpts, notlinkerOpts;Package.swiftheaderhandleSuperwallDeepLinkis genuinely iOS-onlyandroidMain/.../adapters/DelegateAdapter.kt:38-39,255-257; absent fromsuperwall-androiddelegate/SuperwallDelegate.ktconsumeis Android; iOS echoes the token backcommonMain/Superwall.kt:523IntegrationAttribute.FIREBASE_INSTALLATION_IDis iOS-onlycommonMain/models/events/IntegrationAttribute.kt:39; skip siteAndroidSuperwallBridge.kt:305-315Four members carry
@platform iOS/ "pending upstream support in superwall-android" annotations that no longer hold. The Android bridge calls the real native APIs, andsuperwall-android2.8.0 has all of them:getCustomerInfo()Superwall.kt:390-391"synthesized minimal value"AndroidSuperwallBridge.kt:383real callSuperwall.kt:281getEntitlementsByProductIds()Superwall.kt:341"local-filters"AndroidSuperwallBridge.kt:363real callstore/Entitlements.kt:213customerInfoDidChangeSuperwallDelegate.kt:167DelegateAdapter.kt:246-253wireddelegate/SuperwallDelegate.kt:49customerInfoFlowSuperwall.kt:381DelegateMultiplexer.kt:115-121The bridge's own comments call the old stubs "obsolete" (
AndroidSuperwallBridge.kt:59,61,380) — the caveats were describing the Flutter host's behavior. The docs describe the working behavior and flag the discrepancy. The rot is wider:StreamHolder.kt:47-48andcommonMain/internal/SuperwallBridge.kt:127,136,282,295carry the same stale notes. AlsoREADME.md:79claimsminSdk 26"matching the native superwall-android SDK", but that SDK is 23.Claim audit
A clean-context reviewer audited every falsifiable claim against the KMP and
superwall-androidsources. Findings verified independently before fixing (commit4695d7a):transactionBackgroundViewwas wrongly listed iOS-only —superwall-androidhas it (PaywallOptions.kt:109,138) and the KMP mapper wires it (OptionsMapper.kt:87-91). The page had copied a stale KDoc marker.shouldShowWebRestorationAlert,shouldShowWebPurchaseConfirmationAlert(OptionsMapper.kt:94-96). Neither has an "iOS only" KDoc marker, which is why they were missed.Logger.logcallshandleLoginline before theshouldPrintcheck (superwall-androidlogger/Logger.kt:50), andtrack()adds no dispatcher hop (analytics/internal/Tracking.kt:37) — so both run on the caller's thread, main included. Now documented as not guaranteed rather than "background".subscriptionStatusFlowdoes not force main. It is a bareMutableStateFlow(StreamHolder.kt:41-42); aStateFlowdelivers on the collector's context. Reworded to say collect from a main-dispatched scope. The SDK KDoc makes the same loose claim.One reviewer finding was declined:
icon="History"is valid — an explicit key insrc/lib/grid-icons.ts:121, not a PascalCase fallback.Changelog verified byte-identical to upstream
CHANGELOG.mdapart from frontmatter, per repo convention. All 15 internal links and both anchors resolve.Verification
bun run build:cf— exit 0, all 13 KMP pages prerendered, no KMP errors or warningsbun test— 64 pass, 0 failgit diff --check— cleanNot done here
kmpis not registered insrc/lib/sdk-navigation.ts,search.shared.ts,sdk-options.ts,llms.ts, orsitemap.ts— so no search facet, SDK-selector entry,llms.txt, or sitemap entry.unityandwebare equally absent (SdkSlugisios | android | flutter | expo | react-native), so this is a pre-existing gap across three sections, not a KMP regression. Closing it changes shared app behavior for all three and belongs in its own PR.content/docs/kmp/meta.json— there is no Kotlin/KMP mark ingrid-icons.ts, and the Web SDK ships the same way..claude/launch.jsonwill conflict withjordan/sw-5720-web-sdk-docs, which adds the same file. Trivial to resolve.🤖 Generated with Claude Code