Feature · Paywalls & targeting
Event triggers
Define rules that fire a paywall when your SDK reports a behavioral event. Each rule matches on the event name + optional conditions on event properties, optionally filters by audience, and enforces a per-user cooldown so the same paywall never shows twice in a window.
SDK usage
// When the user hits a free-tier limit, ask stubkit if a paywall should fire.
const result = await stubkit.track(
'hit_export_limit',
{ count: 5, plan: 'free' },
{ userId: currentUser.id },
);
if (result.showPaywall) {
renderPaywall(result.showPaywall);
}How matching works
- Server looks up all active event rules for your app + the event name, sorted by
priority DESC. - Each rule's
conditions.rulesare evaluated against thepropertiesyou sent. Same operator set as audiences. - If the rule has an
audience_id, the user must also match the audience (country, platform, is_trial, etc.). - Cooldown check: if the user has fired this rule within
cooldown_seconds, skip — stored in KV with TTL. - First rule that passes wins.
show_paywallis returned with the offering config.
REST endpoints
POST /v1/events/track— SDK endpoint. Requirespk_live_withtrack:eventsscope.GET/POST /v1/admin/event-rulesPATCH/DELETE /v1/admin/event-rules/:id
Dashboard
app.stubkit.com/apps/{app_id}/event-triggers — rule list, full rule editor with event name, conditions, offering picker, audience picker, priority and cooldown preset.