stubkit docs

Feature · Paywalls & targeting

Audiences

Audiences are named user segments defined by a set of rules. Bind an audience to an offering and the SDK will serve the right paywall to the right user. Offerings without an audience are the always-eligible fallback.

Available fields

FieldSource
countryCF-IPCountry header (ISO-2, lowercase)
platformQuery param ?platform=ios|android|web
app_versionQuery param, semver (e.g. 2.1.3). Compared numerically.
languageQuery param or Accept-Language base
is_trialDerived from active sub source = "trial"
is_payingDerived from active sub source (not trial / not admin_grant)
days_since_signupusers.created_at lookup

Operators

eq · neq · in · nin · gt · gte · lt · lte · contains · starts_with

SDK usage

// Let stubkit pick the best paywall for this user based on audience rules.
const offering = await stubkit.resolveOffering({
  userId: currentUser.id,
  country: currentUser.country,
  platform: 'ios',
  appVersion: '2.1.0',
});
renderPaywall(offering);

REST endpoints

  • GET /v1/admin/audiences — list
  • POST /v1/admin/audiences — create
  • PATCH /v1/admin/audiences/:id — update
  • DELETE /v1/admin/audiences/:id — delete (offerings unlink automatically)
  • GET /v1/offerings/:app_id/resolve — public, returns the highest-priority matching offering