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

# Authentication & Subscriptions

> How authentication affects purchase syncing and what happens without it

## Do I need authentication?

**No — subscriptions work without authentication.** Your app can process purchases in anonymous mode. However, there's an important trade-off.

## With authentication

When your app has authentication (e.g. via Clerk or Supabase), Newly automatically:

* Syncs purchases to the user's account via their user ID
* Enables **cross-device purchase syncing** — if a user subscribes on one device, their subscription is recognized on all devices where they're signed in
* Handles restore purchases automatically when a user signs in on a new device

## Without authentication (anonymous mode)

When there's no authentication:

* Purchases work normally on the device where they were made
* **Purchases do not sync across devices** — if a user switches phones or reinstalls the app, their subscription won't carry over
* Users would need to use Apple/Google's built-in restore purchases to recover their subscription on a new device

<Warning>
  Without authentication, if a user reinstalls your app or switches to a new device, they will appear as a new (non-subscribed) user. Their subscription still exists in the App Store/Play Store, but the app won't know about it until they manually restore purchases.
</Warning>

## Recommended approach

<Tip>
  **Set up authentication before adding subscriptions.** This gives your users the best experience with automatic cross-device syncing. The AI agent will also recommend this order.
</Tip>

If you add subscriptions first and authentication later, the system will automatically adapt — it detects the auth context and adds user ID syncing to the subscription provider.

## Restore Purchases button

<Info>
  **Apple requires a Restore Purchases button** (App Store Review Guideline 3.1.1) for any app with in-app purchases or subscriptions. Make sure your app includes a visible way for users to restore previous purchases. If it doesn't, ask the AI to add one.
</Info>
