Development mode

Test purchases and access in debug builds without the App Store or Google Play.

Development mode lets a debug build buy from a simulated store while Voidhash processes the purchase for real: products, perks, receipts and analytics all behave as in production. Use it to build your purchase flow before you connect a store. Its purchases are recorded in the test environment and never unlock production; see Environments.

Turn it on

Create the client with dev: true and the test publishable key in debug builds:

src/lib/voidhash.ts
import { createVoidhashClient } from "@voidhash/react-native";

export const voidhash = createVoidhashClient(__DEV__ ? "vh_pk_test_..." : "vh_pk_...", {
  dev: true,
});
  • dev only works in debug builds. Release builds ignore it and use the real store.
  • Voidhash refuses simulated purchases made with the production key.
  • Enable simulated purchases in Settings → Payment providers must be on. It is on for new projects.
  • Subscription products need a billing duration, which sets their renewal and expiry dates. No store mapping is needed.
  • Observer mode blocks simulated purchases like any other, with READ_ONLY_PURCHASE_NOT_ALLOWED.

A purchase shows a confirmation sheet instead of the store sheet. After you confirm, the SDK records the purchase with Voidhash and refreshes the person, so useHasPerk sees the new perk.

A purchase made while Voidhash can't be reached returns with synced: false, and its perk isn't granted yet. The SDK keeps it and sends it again for the person who bought it, even after a sign-out or sign-in, as it does a store receipt: every few seconds while the app is in the foreground, and on flush(), syncPurchases() and restorePurchases(), which fails while one is still waiting. After five failed attempts in a row the SDK stops sending to Voidhash for 30 seconds, doubling up to 5 minutes while it keeps failing; flush() ends that pause, and so does the connection coming back, at most once a minute. Buying a subscription or non-consumable product the person already holds records nothing new, as neither store sells it twice; the purchase still completes.

Test prices

Simulated products use fixed USD prices:

ProductPrice
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

A subscription without a duration is simulated as monthly, with a warning.

Simulate renewals and refunds

Move a person's simulated purchases through their lifecycle with the CLI. Each action applies once, however often you run it.

voidhash sandbox view user_123
voidhash sandbox renew user_123
voidhash sandbox grace-period user_123 pro_monthly

Install the CLI first. The same actions work through the MCP server and the HTTP API; see Simulate renewals, expiry and refunds.

CommandEffect
sandbox view <person>Shows the person's simulated subscriptions, purchases and access.
sandbox renew <person> [product]Renews a subscription for another period.
sandbox expire <person> [product]Ends a subscription now.
sandbox grace-period <person> [product]Starts a 3-day billing grace period.
sandbox refund <person> [product]Refunds a one-time purchase; its access ends.
sandbox revoke <person> [product]Revokes a purchase or subscription.
sandbox resetDeletes every simulated purchase in the project.

<person> is a distinct ID, email or person ID. Pass [product] when the person has several.

In Studio, choose Test in the environment switcher to see simulated purchases and their revenue. Delete simulated purchases in Settings → Payment providers does the same as sandbox reset; it never touches production, store sandbox, Stripe test mode or payment source test purchases.

Next steps

Something wrong or missing on this page? Tell us by email or on Discord.