RevenueHogdocs
SDKs

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 wantSDK needed?
Revenue feed, MRR, churn, push alertsNo. Server-side ingestion covers it.
Know which of your app users made a purchaseYes
Device model, OS version and locale on customer profilesYes
Custom attributes on customer profilesYes
Change or A/B test the products a paywall offers without a releaseYes (or the raw HTTP API)
Onboarding funnel stepsNo SDK method yet. Use the events endpoint.

The SDKs

SDKPackagePlatformsPurchasesVersion
iOS (Swift)RevenueHog (Swift Package Manager)iOS 15+, macOS 12+, tvOS 15+, watchOS 8+Automatic through StoreKit 20.2.0
Android (Kotlin)com.revenuehog:revenuehog-androidAndroid, minSdk 24Optional Play Billing listener wrapper, or one manual call0.2.0
React Native@revenuehog/react-nativeReact Native and Expo (pure JS, works in Expo Go)Automatic through react-native-iap when installed, or one manual call0.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. identify re-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 configure is a logged no-op.
  • Idempotent writes. The server merges repeated identify and attribute calls, 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

MethodSwiftKotlinReact Native
ConfigureRevenueHog.configure(options:)RevenueHog.configure(context, options)RevenueHog.configure(config)
Identifyidentify(userId:)identify(userId)identify(userId)
AttributessetAttributes(_:)setAttributes(map)setAttributes(attrs)
Attribute a purchaseattributePurchase(originalTransactionId:productId:)attributePurchase(purchaseToken, productId)attributePurchase({ originalTransactionId, productId, jws })
Log outreset()reset()reset()
Flush the queueAutomaticflush()flush()
Paywall SKUspaywall(for:fallback:forceVariant:)paywall(entitlement, fallback, forceVariant) { }paywall(entitlement, fallback, options)
Paywall impressionpaywallShown(_:rendered:)paywallShown(paywall, rendered)paywallShown(paywall, rendered)
Play Billing helperbillingListener(delegate)

Endpoints the SDKs call

EndpointCalled by
POST /api/sdk/v1/attest/challengeSwift only (App Attest enrollment)
POST /api/sdk/v1/attestSwift only (App Attest enrollment)
POST /api/sdk/v1/identifyAll three
POST /api/sdk/v1/attributeAll three
POST /api/sdk/v1/paywallAll three
POST /api/sdk/v1/paywall/impressionAll three
POST /api/sdk/v1/eventsNo SDK yet (raw HTTP)
POST /api/sdk/v1/feedbackNo SDK yet (raw HTTP)
POST /api/sdk/v1/adservicesNo 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.

Last updated on

On this page