Superwall

Capacitor

Superwall plugin for Capacitor by Capawesome

Community SDK

This SDK is developed and maintained by Capawesome, not by Superwall. For support, please visit the official documentation.

The Capacitor Superwall plugin by Capawesome enables you to integrate Superwall into your Capacitor apps for iOS and Android.

Installation

Install the plugin via npm:

npm install @capawesome/capacitor-superwall
npx cap sync

Android Setup

Add the following activities to your AndroidManifest.xml inside the <application> tag:

<activity android:name="com.superwall.sdk.paywall.vc.SuperwallPaywallActivity" android:theme="@style/Theme.AppCompat.DayNight.NoActionBar" />
<activity android:name="com.superwall.sdk.debug.DebugViewActivity" android:theme="@style/Theme.AppCompat.DayNight.NoActionBar" />
<activity android:name="com.superwall.sdk.debug.localizations.SWLocalizationActivity" android:theme="@style/Theme.AppCompat.DayNight.NoActionBar" />
<activity android:name="com.superwall.sdk.debug.SWConsoleActivity" android:theme="@style/Theme.AppCompat.DayNight.NoActionBar" />

Configuration

Initialize the SDK with your API key:

import { Superwall } from '@capawesome/capacitor-superwall';

await Superwall.configure({
  apiKey: 'YOUR_API_KEY',
  options: {
    paywalls: {
      shouldPreload: true,
      automaticallyDismiss: true
    },
    logging: {
      level: 'WARN',
      scopes: ['ALL']
    }
  }
});

Core Methods

MethodDescription
configure()Initialize the SDK with your API key
register()Present a paywall for a placement
getPresentationResult()Check if a paywall would display
identify()Associate a user ID with the current user
reset()Clear user identity on logout
setUserAttributes()Set custom user attributes
getSubscriptionStatus()Get the current subscription status

Event Listeners

The plugin supports the following event listeners:

  • superwallEvent - Analytics events
  • subscriptionStatusDidChange - Subscription status changes
  • paywallPresented - Paywall displayed
  • paywallWillDismiss - Before paywall closes
  • paywallDismissed - After paywall closes
  • customPaywallAction - Custom paywall element interactions

Full Documentation

How is this guide?

Edit on GitHub