The Publishable Key
The snippet runs in the customer’s browser, so it authenticates with your publishable key (rev_pk_...) — not your secret API key.
Installation
Add one script tag to your app, ideally just before the closing</body> tag.
Option 1 — Data attributes
Option 2 — Config object
Setwindow.RevtainPaywall before the script loads — useful when the signed-in customer’s email is only known at runtime.
Configuration
Data-attribute names are the kebab-case form of each field —
data-publishable-key, data-customer-email, data-card-update-url, and so on.
How It Behaves
- Shows only for past-due customers. The snippet calls
GET /api/recovery/paywall-statusonce per browser session. If the customer has no unrecovered failed payment, nothing renders. - Checked once per session. The result is cached in
sessionStorage, so route changes in a single-page app do not re-call the API. - Never blocks your app. If the check times out or errors, the snippet stays silent. A Revtain outage cannot break your app.
- Dismissible. The overlay includes a dismiss link. The wall is a prompt, not a lock.
What the Customer Sees
The overlay states that a payment is past due, shows the amount owed when available, and offers a button to update the payment method. PointcardUpdateUrl at a page where the customer can fix their card — your billing settings page is the usual choice.