Skip to main content

Use Cursor, Claude Code, or another AI to help you implement the Superwall integration with Appstack.

Open in Cursor
With the Superwall integration, you can:
  1. Use Superwall in-app events to run enhanced app campaigns.
  2. Unlock attribution-based paywall optimization.
To successfully connect Superwall, you must:
  1. Have Owner/Admin access to an Appstack organization.
  2. Have access to the correct Superwall account.

Requirements

Use a Superwall SDK version that includes the Appstack integration attribute:
PlatformPackageMinimum version
iOSSuperwall-iOS4.12.11
AndroidSuperwall-Android2.7.5
FlutterSuperwall-Flutter2.4.11
React Native / Expoexpo-superwall1.0.5
For React Native apps, use expo-superwall. The legacy react-native-superwall package is archived.

Connect to Superwall

Follow the steps to ensure the Superwall integration works:
1

SDK configuration

To successfully receive the Appstack ID, set the Appstack integration attribute after the calls to Superwall and Appstack configure methods:
// Use Superwall-iOS version >= 4.12.11

Superwall.shared.setIntegrationAttributes([
  IntegrationAttribute.appstackId: AppstackAttributionSdk.shared.getAppstackId()
])
// Use Superwall-Android version >= 2.7.5

Superwall.instance.setIntegrationAttributes(
    mapOf(IntegrationAttribute.appstackId to AppstackAttributionSdk.getAppstackId())
)
// Use expo-superwall version >= 1.0.5

const { setIntegrationAttributes } = useUser();
const appstackId = await AppstackSDK.getAppstackId();
await setIntegrationAttributes({ appstackId });
// Use Superwall-Flutter version >= 2.4.11

await Superwall.shared.setIntegrationAttributes({
  IntegrationAttribute.appstackId: await AppstackPlugin.getAppstackId(),
});
To show paywalls based on where your users came from (paid ads), set Appstack’s attribution params as user attributes before your first Superwall.register call. You do not need to repeat this for every placement.
Learn more about how to use ad campaign data to show personalized paywalls and increase subscription revenue by reading this article.
Task {
  Superwall.shared.setUserAttributes(
    await AppstackAttributionSdk.shared.getAttributionParams() ?? [:]
  )

  // Now, your placements will attach those user attributes, making
  // them available for use in campaign filters.
  Superwall.shared.register(placement: "onboarding_paywall")
}
fun prepareSuperwallPlacement() {
    Superwall.instance.setUserAttributes(
        AppstackAttributionSdk.getAttributionParams()
    )

    // Now, your placements will attach those user attributes, making
    // them available for use in campaign filters.
    Superwall.instance.register("onboarding_paywall")
}

// Call prepareSuperwallPlacement() after Appstack initialization and before this placement can be shown.
const { update } = useUser();
const { registerPlacement } = usePlacement();

await update((await AppstackSDK.getAttributionParams()) ?? {});

// Now, your placements will attach those user attributes, making
// them available for use in campaign filters.
await registerPlacement({ placement: 'onboarding_paywall' });
// Use Superwall-Flutter version >= 2.4.11

await Superwall.shared.setUserAttributes(
  (await AppstackPlugin.getAttributionParams()) ?? {},
);

// Now, your placements will attach those user attributes, making
// them available for use in campaign filters.
await Superwall.shared.register("onboarding_paywall");
2

Copy the credentials

  1. In Appstack, from the side menu, select Integrations > Superwall.
  2. Copy the access token.
  3. Copy the app ID.
3

Paste the credentials

  1. In Superwall, from the side menu, select Integrations > Appstack.
  2. Paste the access token.
  3. Paste the app ID.
Information
  1. After the integration is active on Superwall’s platform, it can take 30-60 minutes to appear as active on Appstack’s side.
  2. It’s recommended not to edit or modify the integration on Superwall’s platform to avoid attribution issues.
The integration will show an error if less than 50% of events received over the last 24 hours include an appstackId. When this threshold is not met, these events cannot be used in ad network integration pages.

List of events

Below is a list of events you can forward to ad networks to optimize your campaigns.
NameDefinition
sw_trial_startedFired when a user begins a free trial. Triggered on the initial purchase when the period type is TRIAL.
sw_trial_qualifiedFired when a free trial is still active two hours after it started — meaning the user did not cancel within the qualification window.
sw_trial_convertedFired when a free trial successfully converts to a paid subscription. This happens on the first renewal after the trial period ends.
sw_intro_startedFired when a user begins an intro offer — a paid trial at a discounted price (e.g., $0.99 for the first week). Triggered on the initial purchase when the period type is INTRO
sw_trial_intro_startedFired when either a free trial starts (sw_trial_started) or an intro offer starts (sw_intro_started). The event triggers as soon as at least one of these conditions is met.
sw_trial_intro_qualifiedFired when either a free trial qualifies (sw_trial_qualified) or an intro offer starts (sw_intro_started). The event triggers as soon as at least one of these conditions is met.
sw_initial_purchaseFired when any of the following occur: a free trial starts (sw_trial_started), an intro offer starts (sw_intro_started), or a full-price subscription starts (sw_subscription_started). The event triggers as soon as at least one of these conditions is met.
sw_initial_purchase_qualifiedFired when any of the following occur: a trial qualified happens (sw_trial_qualified), an intro offer starts (sw_intro_started), or a full-price subscription starts (sw_subscription_started). The event triggers as soon as at least one of these conditions is met.
sw_subscription_startedFired when a user starts a paid subscription at full price, with no trial or intro offer involved. Triggered on the initial purchase when the period type is NORMAL
sw_subscription_renewedFired on each successful renewal of an active subscription. Indicates the user was billed again and remains subscribed for another period.
sw_non_renewing_purchaseFired when a user makes a one-time, non-subscription purchase — any product that is not an auto-renewing subscription (e.g., consumables or non-consumable in-app purchases). Unlike subscription events, this purchase does not renew automatically.

Use Cursor, Claude Code, or another AI to validate your existing Superwall + Appstack integration.

Open in Cursor