<ppl-access-point-widget> element with your API key. Simply paste this code into the appropriate place in your e-shop (e.g. the checkout template, order detail page, etc.) and the widget will be automatically initialized when the page loads.<script> tag with the loader — ideally belongs in the <head> section of the host page. The loader downloads all required widget assets (JS, CSS, runtime configuration) and registers the <ppl-access-point-widget> Custom Element. The script can also be placed at the end of <body>, but placing it in <head> is recommended so the widget is ready as early as possible.<ppl-access-point-widget> element — belongs exactly where the widget should be displayed in the DOM (typically in the checkout template or the shipping selection section). The api-key attribute links the widget to the specific settings in the admin; the id attribute enables convenient JavaScript access (document.getElementById("pplWidget")) — for example, for listening to events or calling the open() method in modal mode.api-key and fetches the active configuration from the admin. The most important options include:viewMode) — the widget's default mode is modal (the widget is hidden and opens after calling the open() method). In the admin, the mode can be switched to inline (the widget appears directly in the page flow). This setting is applied automatically based on api-key and does not need to be duplicated in the config attribute. If a specific page needs a different mode than the one set in the admin, it can be overridden via config (e.g. config='{"viewMode":"inline"}').api-key and do not need to be specified in the config attribute on the host page.Note: Until changes in the admin are saved and activated (the Activate button at the top of the screen), the widget on the host page uses the last activated configuration version. This allows you to safely prepare changes without the risk of them immediately affecting production.
viewMode: "inline" on a page where the widget should be embedded directly in the layout, even if the admin has modal set). In that case, add a config attribute with a JSON object to the element — see chapter 2.4 for details.ref in React for DOM node access) — see chapters 5 and 6.ppl-accesspointwidget-select, ppl-accesspointwidget-ready), or change configuration at runtime.config, event listeners) to the snippet, or wrap it in an appropriate framework component. The rest of the settings still come from the admin based on api-key.modal — for inline display you must either have the mode switched to inline in the widget admin (by api-key), or force it on the element via config='{"viewMode":"inline"}'. Language, country, and other parameters are also inherited from the admin, so the minimal example below assumes the admin has the mode set to inline:Note: Only use the configattribute if you want to override a default admin setting for a specific page — typically when the admin has modal mode set but a specific page needs the widget displayed inline (config='{"viewMode":"inline"}'). See chapter 2.4 for details.
config attribute is not needed — just provide api-key. In the example below, config='{"viewMode":"modal"}' is specified explicitly so the example works regardless of the current admin setting:https://www.ppl.cz/accesspointwidget/loader.jsconfiguration.js with runtime configuration (API URL, keys)<ppl-access-point-widget> Custom Element is registeredapi-key and fetch configurationppl-accesspointwidget-ready event is emitted