Development purchase mode
Test purchases and lifecycle changes without App Store or Google Play setup.
Development purchase mode lets a React Native debug build buy from a fake store while Voidhash processes the purchases for real. Use it to test your purchase flow, entitlement checks, and subscription lifecycle handling before you connect App Store Connect or Google Play Console.
Everything the fake store creates is recorded in the test environment: purchases, subscriptions, grants and revenue events. Test purchases never unlock access in production or count toward production revenue.
Development mode needs the project's test publishable key (vh_pk_test_…). Voidhash refuses
simulated purchases made with the production key, so configure the test key in debug builds and
the production key in the release builds you publish.
Enable it
Start in Studio. Create a product and attach its perks. Subscription products need a billing duration, because the duration controls their simulated renewal and expiry dates. You do not need to connect App Store Connect or Google Play Console.
Then turn on the dev option when you create the client.
import { createVoidhashClient } from "@voidhash/react-native";
export const voidhash = createVoidhashClient(__DEV__ ? "vh_pk_test_..." : "vh_pk_...", {
dev: true,
});With the option on, a purchase shows a confirmation sheet instead of the store sheet. The SDK waits briefly to simulate processing. Once the backend accepts the purchase, the SDK refreshes the person snapshot, so your entitlement checks see the new grant.
The SDK only honors dev: true in a debug build. Release builds always use the real store adapter,
and the fake-store adapter is dynamically loaded only from the internal debug branch. Set
dev: false if you want a debug build to use the real store.
Simulated purchases are started by the SDK, so they need the default owner mode. In
observer mode, purchase() returns
READ_ONLY_PURCHASE_NOT_ALLOWED.
Fixed test prices
Simulated purchases use fixed USD prices, so you do not need store pricing to test.
| Product | USD price |
|---|---|
| Weekly subscription | $4.99 |
| Monthly subscription | $9.99 |
| Quarterly subscription | $24.99 |
| Six-month subscription | $39.99 |
| Annual subscription | $49.99 |
| Non-consumable | $19.99 |
| Consumable | $4.99 |
Legacy subscriptions without a duration are simulated as monthly and return a warning.
Simulate lifecycle events
With Test selected in Studio, open a person to move a simulated subscription through its lifecycle. You can renew, expire, revoke, or refund it, or place it into a three-day grace period. Each action is idempotent: applying it twice has the same effect as applying it once.
Simulated purchases are marked in Studio. The environment switcher next to the project name shows them under Test, together with Stripe test mode and payment-source test purchases, and the simulated-purchase tools appear there too. Store sandbox purchases appear under Sandbox.
Project settings let you disable new simulated purchases. They also let you wipe simulated data: every simulated purchase, subscription, grant, transaction and purchase-ledger record. Wiping never touches production or sandbox data, or Stripe test mode and payment-source test purchases.
The Swift and Kotlin SDKs have the same development purchase mode. The web SDK has no purchase adapter, so web paywalls continue to use their existing checkout integration.