Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions content/docs/expo/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ description: "Release notes for the Superwall Expo SDK"

# Changelog

## 1.2.0

### Minor Changes

- 694c1b1: Update native SDKs (iOS 4.16.1, Android 2.7.20) and add `eventTrackingBehavior` (deprecates `isExternalDataCollectionEnabled`), the `singularDeviceId` integration attribute, a runtime `setEventTrackingBehavior`, and `getStoreFrontCountryCode()`.
Comment thread
dcrawbuck marked this conversation as resolved.

## 1.1.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion content/docs/expo/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ If you have feedback on any of our docs, please leave a rating and message at th

If you have any issues please [open an issue on GitHub](https://github.com/superwall/expo-superwall/issues).

<SdkLatestVersion version="v1.1.6" repoUrl="https://github.com/superwall/expo-superwall" />
<SdkLatestVersion version="v1.2.0" repoUrl="https://github.com/superwall/expo-superwall" />
8 changes: 8 additions & 0 deletions content/docs/expo/sdk-reference/hooks/useSuperwall.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ The hook returns an object representing the Superwall store. If a `selector` fun
type: "(level: string) => Promise<void>",
description: "Sets the SDK log level (debug, info, warn, error, none).",
},
setEventTrackingBehavior: {
type: "(behavior: EventTrackingBehavior) => Promise<void>",
description: "Sets which events Superwall tracks at runtime (\"all\", \"superwallOnly\", or \"none\"), for GDPR/data-collection control.",
},
setIntegrationAttributes: {
type: "(attributes: IntegrationAttributes) => Promise<void>",
description: "Sets third-party integration identifiers, including `appstackId` for Appstack.",
Expand All @@ -106,6 +110,10 @@ The hook returns an object representing the Superwall store. If a `selector` fun
type: "() => Promise<Record<string, any>>",
description: "Returns device attributes from the native SDK.",
},
getStoreFrontCountryCode: {
type: "() => Promise<string | undefined>",
description: "Retrieves the App Store / Play Store storefront country code for the current device.",
},
getEntitlements: {
type: "() => Promise<EntitlementsInfo>",
description: "Fetches the user's entitlement snapshot, including active and inactive entitlements, plus all known entitlements when exposed by the native bridge.",
Expand Down
2 changes: 1 addition & 1 deletion content/docs/expo/sdk-reference/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ If you have feedback on any of our docs, please leave a rating and message at th

If you have any issues with the SDK, please [open an issue on GitHub](https://github.com/superwall/expo-superwall/issues).

<SdkLatestVersion version="v1.1.6" repoUrl="https://github.com/superwall/expo-superwall" />
<SdkLatestVersion version="v1.2.0" repoUrl="https://github.com/superwall/expo-superwall" />
19 changes: 19 additions & 0 deletions content/docs/integrations/singular.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,25 @@ Superwall.instance.setIntegrationAttributes(
)
```

### Expo

On Expo SDK `1.2.0` and later, `singularDeviceId` is available as a typed integration attribute on the hooks API.

```tsx
import { useSuperwall } from "expo-superwall"

function SingularAttribution({ sdid }: { sdid: string }) {
const setIntegrationAttributes = useSuperwall((state) => state.setIntegrationAttributes)

const linkSingular = async () => {
// After Singular returns an SDID
await setIntegrationAttributes({ singularDeviceId: sdid })
}

// Call linkSingular() once you have the SDID.
}
```

### Other SDKs

If your Superwall SDK does not yet expose a typed Singular integration attribute, set `singularDeviceId` as a user attribute instead.
Expand Down
49 changes: 41 additions & 8 deletions content/shared/configuring/using-superwalloptions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -411,18 +411,51 @@ Superwall.configure(

:::expo

Expo currently uses `isExternalDataCollectionEnabled`. Setting it to `false` suppresses user-initiated tracking, trigger-fire events, and user-attribute updates while keeping internal Superwall event collection enabled.
On Expo SDK `1.2.0` and later, use the `eventTrackingBehavior` option on the hooks/provider API (`expo-superwall`). It is a string-union field — pass one of the following string values:

```typescript
const options = SuperwallOptions()
options.isExternalDataCollectionEnabled = false
| Behavior | What Superwall sends |
| --- | --- |
| `"all"` | All SDK event collection is enabled. This is the default. |
| `"superwallOnly"` | Internal Superwall events continue to be sent, but user-initiated `Superwall.track(...)` calls, trigger-fire events, and user-attribute updates are suppressed. |
| `"none"` | No SDK events are sent to Superwall. Paywalls still work because paywall logic runs on device, but dashboard analytics, attribution matching, and audience rules that depend on `acquisition_*` attributes will not receive this event data. |

Set the initial behavior by passing it in `options` to `SuperwallProvider`:

```tsx
import { SuperwallProvider } from "expo-superwall"

export default function App() {
return (
<SuperwallProvider
apiKeys={{ ios: "MY_IOS_API_KEY", android: "MY_ANDROID_API_KEY" }}
options={{ eventTrackingBehavior: "none" }}
>
<YourApp />
</SuperwallProvider>
)
}
```

Superwall.configure(
"MY_API_KEY",
options: options
);
You can also change the behavior at runtime after the SDK is configured. This is useful when a user changes a privacy or consent setting in your app.

```tsx
import { useSuperwall } from "expo-superwall"

function PrivacySettings() {
const setEventTrackingBehavior = useSuperwall((state) => state.setEventTrackingBehavior)

const disableTracking = async () => {
await setEventTrackingBehavior("none")
}

// Call disableTracking() from your consent UI.
}
```

`isExternalDataCollectionEnabled` is deprecated on Expo SDK `1.2.0` and later. If older code sets it to `false`, the SDK maps that to `"superwallOnly"`, not `"none"`. Use `"none"` when your app needs to stop SDK event collection entirely.

The compat API (`expo-superwall/compat`) also adds `eventTrackingBehavior` in `1.2.0`, but its `EventTrackingBehavior` enum is not yet exported from that entry point. Use the hooks/provider API shown above until a later SDK release exports it.

:::

### Automatically Dismissing the Paywall
Expand Down
Loading