SDKs overview
Optional client SDKs for iOS, Android and React Native that link purchases to your own user IDs, add device context and serve paywall SKUs from the dashboard.
RevenueHog needs no SDK. Revenue, the live feed, metrics, customers and alerts all work server-side from your App Store Connect key, Google Play connection or Stripe connection. The SDKs are optional add-ons for the few things the server cannot know on its own.
What the SDKs add
Without an SDK, a customer is an anonymous handle derived from the store transaction (for example customer_8f3c2a). With one, you get:
- User-level attribution. Each purchase is linked to the user ID your app uses, so customer profiles show your ID instead of a derived handle. See Attribution.
- Device context. OS version, device model and locale on the customer profile.
- Custom attributes. A flat map of strings (
plan,cohort, anything you like) stored on the profile. - Server-driven paywall SKUs. The dashboard decides which products a paywall offers, in which order, and can A/B test the offer set without an app update. See Paywall and Experiments.
Signpost events, in-app feedback and the Apple Ads attribution token use the same keyless endpoints, but the SDKs do not wrap them yet. Send them with a plain HTTP request. See Events, Feedback and Attribution.
The SDKs send no IDFA, do no fingerprinting and upload no receipts. If an SDK is offline or missing, your revenue data is unaffected; customers simply stay anonymous.
Do you need an SDK?
| You want | SDK needed? |
|---|---|
| Revenue feed, MRR, churn, push alerts | No. Server-side ingestion covers it. |
| Know which of your app users made a purchase | Yes |
| Device model, OS version and locale on customer profiles | Yes |
| Custom attributes on customer profiles | Yes |
| Change or A/B test the products a paywall offers without a release | Yes (or the raw HTTP API) |
| Onboarding funnel steps | No SDK method yet. Use the events endpoint. |
The SDKs
| SDK | Package | Platforms | Purchases | Version |
|---|---|---|---|---|
| iOS (Swift) | RevenueHog (Swift Package Manager) | iOS 15+, macOS 12+, tvOS 15+, watchOS 8+ | Automatic through StoreKit 2 | 0.2.0 |
| Android (Kotlin) | com.revenuehog:revenuehog-android | Android, minSdk 24 | Optional Play Billing listener wrapper, or one manual call | 0.2.0 |
| React Native | @revenuehog/react-native | React Native and Expo (pure JS, works in Expo Go) | Automatic through react-native-iap when installed, or one manual call | 0.2.0 |
All three live in one repository, https://github.com/Parra-Inc/revenue-hog-sdks, and have zero runtime dependencies.
Distribution
The Swift package installs straight from the Git URL. The npm package and the Maven artifact are not published to a public registry yet: install them from a local checkout as described on the React Native and Android pages, or call the HTTP API directly.
Behavior shared by all three
- One required line at launch:
configure. Everything else is optional. - No API key. The iOS SDK proves which app it is with App Attest. Android and React Native send unattested requests that RevenueHog resolves by bundle ID and labels unverified. See Authentication.
- Anonymous first. A persisted anonymous ID (
$anon_<uuid>) is used before login, so purchases attribute immediately.identifyre-attributes them to your real user ID afterward. - Offline-safe. A failed request (network error,
429,5xx) retries with exponential backoff, at most 3 attempts, then goes into a persistent queue (cap 100) that flushes on the next call or launch. - Never crashes the host app. Every failure is swallowed into a debug log. Calling a method before
configureis a logged no-op. - Idempotent writes. The server merges repeated
identifyandattributecalls, and each SDK also skips transactions it already reported for the current user. - Self-hosting. Every SDK accepts a base URL override. The default is
https://revenuehog.dev.
API at a glance
| Method | Swift | Kotlin | React Native |
|---|---|---|---|
| Configure | RevenueHog.configure(options:) | RevenueHog.configure(context, options) | RevenueHog.configure(config) |
| Identify | identify(userId:) | identify(userId) | identify(userId) |
| Attributes | setAttributes(_:) | setAttributes(map) | setAttributes(attrs) |
| Attribute a purchase | attributePurchase(originalTransactionId:productId:) | attributePurchase(purchaseToken, productId) | attributePurchase({ originalTransactionId, productId, jws }) |
| Log out | reset() | reset() | reset() |
| Flush the queue | Automatic | flush() | flush() |
| Paywall SKUs | paywall(for:fallback:forceVariant:) | paywall(entitlement, fallback, forceVariant) { } | paywall(entitlement, fallback, options) |
| Paywall impression | paywallShown(_:rendered:) | paywallShown(paywall, rendered) | paywallShown(paywall, rendered) |
| Play Billing helper | billingListener(delegate) |
Endpoints the SDKs call
| Endpoint | Called by |
|---|---|
POST /api/sdk/v1/attest/challenge | Swift only (App Attest enrollment) |
POST /api/sdk/v1/attest | Swift only (App Attest enrollment) |
POST /api/sdk/v1/identify | All three |
POST /api/sdk/v1/attribute | All three |
POST /api/sdk/v1/paywall | All three |
POST /api/sdk/v1/paywall/impression | All three |
POST /api/sdk/v1/events | No SDK yet (raw HTTP) |
POST /api/sdk/v1/feedback | No SDK yet (raw HTTP) |
POST /api/sdk/v1/adservices | No SDK yet (raw HTTP) |
The wire contract for every endpoint is in the SDK API reference.
Agent skills
If you use Claude Code, three skills in the RevenueHog repository automate the integration: revenuehog-integration (first-time setup), revenuehog-paywall (move hardcoded product IDs to server-driven SKUs) and revenuehog-experiments (run paywall tests from the terminal). See Skills.
Related
Last updated on
Privacy and sharing
Hide amounts and app identity in the RevenueHog iOS app, build redacted share cards from your numbers or screenshots, and lock the app with Face ID lock.
iOS SDK
Install the RevenueHog Swift package, enable App Attest, and attribute StoreKit 2 purchases to your users automatically with one line of code at app launch.