Skip to main content
Parameters, customizations, and advanced features for all Web SDK flows. See Quickstart guide and Choose the Right Integration for You for introductory information.

TypeScript support

TypeScript: Yuno provides a TypeScript library for all available methods.

Subresource Integrity (SRI)

This browser security feature lets you ensure a loaded script has not been tampered with. You provide a cryptographic hash alongside the script URL; the browser verifies the downloaded bytes match the declared hash before executing the code.
  • Integrity: Guarantees the exact code built and published is what runs in the browser.
  • Immutability: When paired with full semantic version URLs, it ensures stable, reproducible integrations.
  • Defense-in-depth: Mitigates risks from supply-chain or transport-layer compromise.

URL formats

When implementing SRI, use the full semantic version URL format to ensure immutable, tamper-evident integrations.
  • Full (immutable) URL with SRI: Full semantic version path used for locked, tamper-evident integrations with an SRI hash.
  • Partial (mutable) URL: Version with major and minor (e.g., v1.9).  This version will receive patch improvements.  This is useful if you like to avoid updates in your code base.

How to integrate the SDK with SRI

Replace src and integrity with the environment/version you target. crossorigin="anonymous" lets the browser validate the SRI for cross-origin scripts. The hash can be found in versions-sri.json at latest.integrity or within the history array.`.
srcfor production is https://sdk-web.y.uno/versions-sri.json .

Using NPM package

Validation notes

  • Open DevTools Network tab and confirm main.js returns 200 from the full-version path.
  • Verify the response headers allow cross-origin fetches for static assets if served from a distinct origin (crossorigin="anonymous" is set).
  • Ensure the integrity attribute exactly matches the generated hash, including the sha384- prefix.
  • Any change to main.js changes the hash. When changing versions, always regenerate or retrieve the new sha384 value and update the integrity attribute.

SRI Troubleshooting

  • Hash mismatchs cause the script to fail execution with an integrity error (e.g., you updated the file but not the hash). To fix, rebuild, retrieve the new sha384 from versions-sri.json, and update integrity.
  • Browser blocks SRI on cross-origin request when the crossorigin attribute is missing or CORS is restrictive. To fix, add crossorigin="anonymous" and configure the static hosting to allow cross-origin fetches for JS assets.

Key parameters (checkout session creation)

When creating a checkout session on your backend, the following parameters are commonly used across web SDKs:

Payment and checkout parameters (full reference)

Parameters for await yuno.startCheckout(), await yuno.mountCheckout(), and related payment flows. All parameters used in Payment flows (Web) are listed here with full detail.

Core parameters

Callbacks

Card form options (card)

Render mode

Custom texts

Express button styling (externalButtons)

The externalButtons property in startCheckout and startSeamlessCheckout (SDK 1.6+) allows merchants to customize the appearance of Google Pay, Apple Pay, and PayPal express buttons. All properties are optional; sensible defaults are used when not provided.
The externalButtons configuration applies to all flows that render express buttons — including mountCheckout, mountExternalButtons, and mountSeamlessExternalButtons — as long as startCheckout or startSeamlessCheckout was called first with the configuration.

Google Pay

Apple Pay

PayPal

Full example

Payment retry

Payment retry lets a shopper fix and re-submit a card payment after it comes back DECLINED or ERROR, without restarting the checkout. Instead of tearing down the card form, the SDK keeps it open, surfaces the decline (field-level errors and a top error banner), and clones the checkout session so the next attempt reuses the same flow. Retry is enabled by the Checkout Builder / Dashboard setting settings.card.enable_payment_retry under styling.settings (default enabled). It is a server-controlled setting, not a startCheckout() argument. It applies to non-enrolled card payments only — enrolled/vaulted cards are excluded. Payment retry is supported across all four Web integrations: Seamless, Full Checkout, Lite, and Secure Fields.

Behavior by integration

Triggering retry in Full Checkout, Lite, and Secure Fields

For these three flows, after your backend creates the payment you must inspect the payment response and drive the SDK accordingly:
  • Card payment that failed (payment_method.type === 'CARD' and status is DECLINED or ERROR): call continuePayment to run the retry — the card form stays open with the decline shown.
  • Additional action required (checkout.sdk_action_required === true): call continuePayment so the SDK can show the required screens (e.g. 3DS or a redirect).
  • Nothing left for the SDK to do (status is not DECLINED/ERROR and checkout.sdk_action_required === false): the SDK will not tear itself down, so you must unmount it manually with unmountSdk.
If the payment method is CARD and the status is DECLINED or ERROR, you must call continuePayment. If you don’t, the card form will not close automatically — the shopper is left on the open form with no next step.When the status is anything other than DECLINED/ERROR and checkout.sdk_action_required is false, call unmountSdk to remove the SDK from the DOM — it does not unmount on its own in these flows.
Secure Fields: set the checkoutSession on the secureFields({ ... }) object, and do not pass it to generateTokenWithInformation({ ... }).Retry is armed when the SDK initializes the secure fields with a checkoutSession, and on each retry the SDK swaps in a freshly cloned session internally. If you also pass checkoutSession to generateTokenWithInformation, that fixed value overrides the cloned one and breaks the retry attempt.

Enrollment parameters (full reference)

Parameters for await yuno.mountEnrollment(). All parameters used in Enrollment flows (Web) are listed here with full detail.

Mount external buttons

Use the mountExternalButtons method to render PayPal, Google Pay, and Apple Pay buttons in custom locations within your UI. This gives you control over where these buttons are displayed.

Parameters

Unmounting buttons

You can unmount a single external button by payment method type:
Or unmount all external buttons at once:

Enrolling payment methods

You can enroll payment methods (store cards for future use) directly during the payment flow by setting payment_method.vault_on_success = true in the checkout session creation. When vault_on_success is set to true:
  • The payment method will be automatically enrolled if the payment status is SUCCEEDED
  • If the payment does not succeed, no vaulting will occur
  • The payment response will include a vaulted_token that you can use for future transactions
Example:
To generate and receive a vaulted_token when vault_on_success = true, the payment must reference an existing Yuno customer through customer_payer.id in the checkout session. Creating or sending the customer data inline inside the payment request does not create the customer on our side, so no vaulting will occur. For enrollment flows, see Enrollment flows (Web).