> ## 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.

# Payments

> RevenueCat subscriptions

# Payments & Subscriptions

The kit uses **RevenueCat** to manage subscriptions.

## Key Files

| File                                | Purpose            |
| ----------------------------------- | ------------------ |
| `lib/revenue-cat.ts`                | RevenueCat setup   |
| `contexts/subscription-context.tsx` | Subscription state |
| `app/paywall.tsx`                   | Paywall UI         |

## Usage

```typescript theme={null}
import { useSubscription } from '@/contexts/subscription-context';

const { isSubscribed, offerings, purchase, restore } = useSubscription();
```

## Setup Steps

1. Create products in **App Store Connect** → Subscriptions
2. Add products to **RevenueCat** → Products
3. Create an **Offering** with your products
4. Add **App-Specific Shared Secret** to RevenueCat

## Testing

1. Create sandbox tester in App Store Connect
2. Sign in with sandbox account on device
3. Test purchase flow

<Note>
  Sandbox subscriptions renew quickly: 1 month = 5 minutes.
</Note>
