Skip to main content

Keys in app.json

After setup, the following keys are added to your app.json (under the extra field): The app automatically selects test keys in development (__DEV__ is true) and production keys in release builds.

Generated files

The AI agent creates or modifies these files:

Dependencies

The react-native-purchases package is installed automatically.
Do not add react-native-purchases to the plugins array in app.json. This causes build errors. The SDK is configured entirely through SubscriptionContext.tsx, not as an Expo plugin.

How API key switching works

The generated SubscriptionContext.tsx includes logic like:
  • In development builds, the Test Store key is used so you can simulate purchases safely
  • In production builds, the real iOS or Android key is used for actual App Store / Play Store purchases
  • This switching is automatic — you don’t need to change anything between environments

Storage key scoping

To prevent conflicts between multiple apps that might share the same Expo slug, the subscription context uses your Newly project ID in its storage key. This ensures subscription state is isolated per-app.