Add in-app purchases to your Capacitor app
Integrate in-app purchases on iOS and Android using Adapty’s Capacitor SDK. Handle receipts, track subscription status, and remove the need to build a backend. All the power in a single integration.
import { adapty } from '@adapty/capacitor';
try {
await adapty.activate({
apiKey: 'YOUR_PUBLIC_SDK_KEY',
params: {
logLevel: 'verbose',
__ignoreActivationOnFastRefresh: true,
}
});
console.log('Adapty activated successfully!');
} catch (error) {
console.error('Failed to activate Adapty SDK:', error);
}
You don’t need to build a backend for Capacitor in-app purchases
Adapty’s SDK takes care of everything that usually lives on the server: receipt validation, subscription status, renewals, trials, and refunds. You just connect it once and get a working Capacitor in-app purchases setup for iOS and Android.
Schedule a demoWhy choose Adapty SDK?
Track subscription status across platforms
You’ll always know if the user has an active subscription across iOS and Android.
Validate receipts on the backend
No need to build your own validation as Adapty takes care of it.
Handle all kinds of subscription states
Free trials, upgrades, promo offers, family sharing, renewals, and more.
Scale on a enterprise-grade core
We ship updates often, keep the SDK stable, and run on >99.99% SLA.
Configuring platforms
Installing Adapty SDK
await adapty.activate(
'PUBLIC_SDK_KEY',
{
customerUserId: 'YOUR_USER_ID',
}
);
'PUBLIC_SDK_KEY',
{
customerUserId: 'YOUR_USER_ID',
}
);
Processing purchasing events
Easy integration for Capacitor
Set up the Adapty SDK in a couple of hours and start working with in-app purchases on iOS and Android. Need help? Check out our full Capacitor IAP tutorial.
Use 5 SDK methods to handle Capacitor IAP
import { adapty } from '@adapty/capacitor';
try {
const result = await adapty.makePurchase({ product });
if (result.type === 'success') {
const isSubscribed = result.profile?.accessLevels['YOUR_ACCESS_LEVEL']?.isActive;
if (isSubscribed) {
// Grant access to the paid features
console.log('User is now subscribed!');
}
} else if (result.type === 'user_cancelled') {
console.log('Purchase cancelled by user');
} else if (result.type === 'pending') {
console.log('Purchase is pending');
}
} catch (error) {
console.error('Purchase failed:', error);
}
import { adapty } from '@adapty/capacitor';
try {
const profile = await adapty.restorePurchases();
const isSubscribed = profile.accessLevels['YOUR_ACCESS_LEVEL']?.isActive;
if (isSubscribed) {
// Restore access to paid features
console.log('Access restored successfully!');
} else {
console.log('No active subscriptions found');
}
} catch (error) {
console.error('Failed to restore purchases:', error);
}
import { adapty } from '@adapty/capacitor';
try {
await adapty.identify({ customerUserId: "YOUR_USER_ID" });
// successfully identified
} catch (error) {
// handle the error
}
import { adapty } from '@adapty/capacitor';
const params = {
email: '[email protected]',
phoneNumber: '+18888888888',
firstName: 'John',
lastName: 'Appleseed',
gender: 'other',
birthday: new Date().toISOString(),
};
try {
await adapty.updateProfile(params);
console.log('Profile updated successfully');
} catch (error) {
console.error('Failed to update profile:', error);
}
import { adapty } from '@adapty/capacitor';
try {
await adapty.updateProfile({
codableCustomAttributes: {
key_1: 'value_1',
key_2: 2,
key_3: null, // to remove keys, pass null as their values
},
});
console.log('Custom attributes updated successfully');
} catch (error) {
console.error('Failed to update custom attributes:', error);
}
Adapty powers apps at every stage from indie to top publishers
Everything you need to grow your app — already in the Capacitor SDK

Increase subscription revenue without app releases
Manage, target, localize and personalize paywalls without leaving your browser.
Increase app revenueCut refund rate by 40%
Stop losing revenue on refunds – Adapty automatically shares user activity data with Apple for refund requests and reduces it.
Set up Refund Saver

Know your subscription numbers at any moment
Measure your in-app economy from trials to refunds with a ready-to-go, real-time subscription BI.
See subscription BINo-code paywall builder
Build beautiful native paywalls for iOS, Android, React Native, Flutter, FlutterFlow, KMP and Capacitor without a dev team.
Create paywalls within minutes