Full widget

Four ways to integrate: headless, bridge, the hosted widget, and the widget without a backend.

Embedded widget

Widget origin: …
This page mounts with publishableKey and getSessionToken. The publishable key identifies the app. The demo worker mints on POST /session when the iframe asks. The snippet sets no theme: colors come from the saved Design Studio config for that key. Override with ?widgetOrigin=, ?pk=, and an unbound ?session=.

Code snippet

…

Pros and cons

Customer effort

  • Pro: least work. One script, one mount() call, and theming through the Design Studio tokens.
  • Pro: the snippet passes publishableKey and getSessionToken. The theme comes from the saved Design Studio config for that key, not from the snippet.
  • Con: customization is limited to theme tokens and config. Layout is bounded by the iframe size.
  • Con: when that config does not load, the page says the widget is using its built-in theme.

Customer security

  • Pro: key, token, and UI all stay on our origin. The swap summary is rendered inside the iframe before the user signs, so a compromised host page cannot change what the user sees.
  • Pro: the least customer code to get wrong.
  • Con: the customer trusts our UI and loader. Wallet calls are relayed through the customer's wallet provider.

Event log