Docs
Editor

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.

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 language

You 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 editorIn your codePage
A plan card's package ID (monthly)A price per package ID in products, and onPurchase receives the IDPackages and pricing
A button action: Run your code, Go to another screen, Close the screen, link, restoreonAction with the action ID, onRestore, and navigation inside the SDKActions and links
Text such as {{ product.price }} and your own variablesValues the SDK computes from products and variablesVariables
TranslationsThe locale optionLocalization
Questions with a field ID and answer IDsonAnswer and answersFlows and questions
PublishA placement only shows published versionsPublish and versions, Validation

Settings that your site chooses

  • Light or dark. The screen defines both. The SDK shows light unless you pass colorMode as dark or system (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' });

On this page