Subscription Concepts

RecurrBase subscriptions are:

  • Time-based

  • On-chain

  • Paid in USDC

  • Auto-renewed via allowance

  • Observable via webhooks


On-Chain Expiration

Each subscriber's expiration timestamp is stored in the SubscriptionManager contract:

mapping(address => uint64) expiration;

Renewal Model

Users approve an allowance → RecurrBase keeper calls:

subscriptionManager.autoRenew(user, months)

Users must approve USDC allowance for automatic renewals to work.


Subscription Lifecycle

  • SUBSCRIPTION_CREATED - New subscription created
  • SUBSCRIPTION_RENEWED - Subscription renewed automatically
  • SUBSCRIPTION_EXPIRED - Subscription expired
  • BILLING_FAILED - Renewal attempt failed (insufficient allowance or balance)

Checking Status

Use the status endpoint to check if a wallet has an active subscription:

const status = await recurrbase.subscriptions.status(walletAddress);
console.log(status.isActive); // true or false
console.log(status.expiresAt); // ISO timestamp

Continue with Webhooks Overview to receive real-time events.