The video uses a specific AI coding tool to demonstrate the setup, but the configuration works 1:1 with Cursor, Claude Code, or any other tool. Despia is web framework and tooling agnostic, so the only thing that matters is the SDK call.
despia.trackingDisabled is a synchronous boolean reflecting the user’s response to the App Tracking Transparency (ATT) prompt on iOS and the equivalent consent flow on Android. Read it on app load, gate analytics and ad SDKs accordingly, and optionally sync it to your backend for compliance auditing.
Installation
- Bundle
- CDN
How it works
Readdespia.trackingDisabled directly. The value is injected by the native runtime before your JavaScript executes, so it is available on first render with no loading state. The value is true when the user has denied tracking consent, false when they have allowed it.
true fallback in the browser is the conservative choice. If you cannot determine consent, assume the user has denied tracking and behave accordingly. This keeps your analytics and ad SDKs from firing during web preview where no consent prompt has happened.
Gate analytics and ad SDKs
Wrap any tracking-dependent initialization behind the consent check. Most analytics SDKs expose either anenable/disable toggle or a “do not track” mode, use those rather than skipping initialization entirely so you can flip the switch later if the user changes their mind in iOS Settings.
Sync consent status to your backend
For compliance audits and to keep server-side behavior aligned with the user’s choice, post the consent status when the user logs in or on every app start. Store it keyed by user ID, with a timestamp so you have an audit trail of when the user’s consent was last verified.merge: true (or your database equivalent) preserves the original createdAt while updating trackingDisabled and lastChecked on every sync, so you can see when consent was first recorded and when it was last verified.
Disabling the ATT prompt entirely
If your app does not need tracking and you want to skip the ATT prompt altogether, declare that intent in the Despia Editor under App > Settings > Disable Tracking Declaration and toggle it on. After enabling, rebuild the app and resubmit to the App Store. The new build will not display the ATT prompt at launch, anddespia.trackingDisabled will always return true for those users.
This is the right choice for apps that do not run ad SDKs and do not pass user identifiers across third-party services. Disabling the declaration improves the first-launch experience by removing one extra system prompt, and it reduces the surface area for App Store review questions about tracking practices.
Resources
NPM Package
despia-native