Integrate subscription payments into your a0 app with code examples
a0-purchases
library.
a0-purchases
library. All apps built with a0 come with the necessary configuration and providers built in.Completed Payment Setup
Synced to Providers
Created Offerings
useA0Purchases
hook:
isPremium
property:
isPremium
returns true if the user has ANY active entitlement. If you have multiple features/entitlements and need to check specific ones, use getCustomerInfo()
.4242 4242 4242 4242
4000 0000 0000 0002
Enable Test Mode
Test Purchase Flow
Verify Entitlements
isPremium
updates correctly and specific entitlements are active.Test Restore
Paywall shows 'No products available'
Purchase fails immediately
isPremium not updating after purchase
Entitlements showing as undefined