What the editor produces
The visual editor builds a screen as JSON (PaywallData). This section covers the parts of a screen your code has to know about.
Your team builds screens in the dashboard's visual editor. This section has two parts: guides for building a screen, and the reference for what the editor hands to your code.
Build a screen
Create a screen, change its look, add plan cards and buttons, and publish. For whoever builds the screens.
Wire it to your code
Package IDs, action IDs, variables, language, answers and publishing, and what your code answers to each. For developers.
A screen is JSON
The editor saves each screen as a PaywallData document. The SDK renders the same document, so what the editor canvas shows is what visitors get.
default_locale language used when no other matches, for example en_US
components_config
base the layout tree: stacks, text, images, plan cards, buttons
components_localizations
en_US every piece of text, by languageYou never edit it by hand. Display format, trigger, audience, A/B test and schedule are not in the JSON. They belong to the placement.
What your code has to know
Each of these is a value the editor sets and your code answers:
| In the editor | In your code | Page |
|---|---|---|
A plan card's package ID (monthly) | A price per package ID in products, and onPurchase receives the ID | Packages and pricing |
| A button action: Run your code, Go to another screen, Close the screen, link, restore | onAction with the action ID, onRestore, and navigation inside the SDK | Actions and links |
Text such as {{ product.price }} and your own variables | Values the SDK computes from products and variables | Variables |
| Translations | The locale option | Localization |
| Questions with a field ID and answer IDs | onAnswer and answers | Flows and questions |
| Publish | A placement only shows published versions | Publish and versions, Validation |
Settings that your site chooses
- Light or dark. The screen defines both. The SDK shows light unless you pass
colorModeasdarkorsystem(follow the device). - Language. Pass
locale; the SDK does not detect it. - Fonts and images. Fonts load from Fontsource on jsDelivr and images from Miniwall storage or the URLs the screen uses. If your site has a Content Security Policy, allow them. See Security and CSP.
- Closing. The SDK adds no close button. A screen closes with a button that has the action Close the screen.
import { configure } from '@miniwall/web';
configure({ apiKey: 'pk_...', colorMode: 'system', locale: 'vi_VN' });