Sandbox and production

The two Paperwall environments, and how to move a site from one to the other.

Paperwall runs two independent environments.

Sandbox Production
Portal sandbox.paperwall.io paperwall.io
API sandbox-api.paperwall.io api.paperwall.io
mode value "sandbox" "live"
Payments A separate Stripe configuration Your own Stripe account

They share no data. Each has its own database, its own sign-in session, and its own Stripe credentials. An account, site, site token, article, or ticket balance that exists in one does not exist in the other.

Which environment a page talks to

The mode value in your wall configuration, and nothing else, decides this:

mode Portal API
live paperwall.io api.paperwall.io
sandbox sandbox.paperwall.io sandbox-api.paperwall.io
local portal.pw.local:5173 api.pw.local:3003

The portal sets it for you: a snippet copied from sandbox.paperwall.io carries mode: "sandbox", and one copied from paperwall.io carries mode: "live". Use local only when developing against a local stack.

Check this value first when a page behaves unexpectedly. A production page left on mode: "sandbox" queries an API that has never heard of its site token, so no wall appears and no visit is recorded.

What sandbox is for

Sandbox is a full copy of Paperwall for rehearsal. Install the snippet, verify the site, add articles, set pricing and thresholds, and walk through an unlock from the reader's side — without involving real money or affecting your live site's reporting.

It is also the safe place to test a configuration change, such as a new postUrls pattern, before applying it to a site that readers are using.

Moving a site to production

Because the two environments share no data, going live is a repeat of onboarding on paperwall.io rather than a setting you change.

  1. Sign in at paperwall.io. Your sandbox sign-in does not carry over, and neither does your sandbox account.
  2. Add your site and copy the new site token. It differs from your sandbox token.
  3. Replace the snippet on your site with the one generated by the production portal. Both siteToken and mode change, so replace the whole block rather than editing one value and missing the other.
  4. If you use the Ghost integration, enter your Ghost admin key again. Integration credentials belong to a site record and do not transfer.
  5. Verify the site.
  6. Add your articles and set their pricing and thresholds. These do not transfer either.
  7. Connect Stripe under Payouts, using the account you want to be paid into.
  8. Publish the site to move it to LIVE.

Rehearse on production before charging

A production site stays in PREVIEW until you publish it. In PREVIEW, the wall runs only for members of your Paperwall team, and payment is refused. You can therefore confirm that the snippet, article detection and wall all behave correctly on the real site, with readers still seeing your articles unchanged, and publish only once you are satisfied.

Setting an article's cost to 0 is a further way to exercise the unlock path without a card.

Running both

Keeping the sandbox site after going live is reasonable, and the environments never interact: a change in one has no effect on the other. Two things to bear in mind if you do.

  • Your sandbox site and production site are separate records with separate tokens, so changing pricing in sandbox does not change it for readers.
  • You are signed in to each environment separately. Being signed in at paperwall.io does not sign you in at sandbox.paperwall.io.

Troubleshooting

  • No wall on production, and nothing in the network tab. The snippet is still on mode: "sandbox", or still carries the sandbox site token.
  • The site is verified in sandbox but not in production. Verification is per environment. Verify again on paperwall.io.
  • A Ghost article unlocks but is empty on production. The admin key was entered in sandbox only. Add it to the production site.
  • Signing in appears not to work. Confirm which portal you are on. The two use separate sessions.