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
| Field | Source |
|---|---|
country | CF-IPCountry header (ISO-2, lowercase) |
platform | Query param ?platform=ios|android|web |
app_version | Query param, semver (e.g. 2.1.3). Compared numerically. |
language | Query param or Accept-Language base |
is_trial | Derived from active sub source = "trial" |
is_paying | Derived from active sub source (not trial / not admin_grant) |
days_since_signup | users.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— listPOST /v1/admin/audiences— createPATCH /v1/admin/audiences/:id— updateDELETE /v1/admin/audiences/:id— delete (offerings unlink automatically)GET /v1/offerings/:app_id/resolve— public, returns the highest-priority matching offering