> ## Documentation Index
> Fetch the complete documentation index at: https://docs.viral-app.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Paywall

> Subscription paywall customization

# Paywall Screen

The paywall is where users subscribe.

## File

`app/paywall.tsx`

## Key Elements

* **Feature list** - What subscribers get
* **Pricing** - Show both plans with savings
* **Trial messaging** - If offering free trial
* **Legal text** - Terms and renewal info

## Purchase Flow

```typescript theme={null}
const handlePurchase = async (pkg) => {
  try {
    const { customerInfo } = await Purchases.purchasePackage(pkg);
    if (customerInfo.entitlements.active['premium']) {
      router.replace('/(main)');
    }
  } catch (error) {
    if (!error.userCancelled) {
      Alert.alert('Error', 'Purchase failed');
    }
  }
};
```

## Required Legal Text

Must display:

* Price
* Subscription duration
* Auto-renewal notice
* Links to Terms and Privacy

## Restore Purchases

Always include restore option for users switching devices.
