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 (for example, 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
Replacesrc 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.
url published alongside the hash in versions-sri.json — each entry pairs a full-version url with the integrity that matches it, for example https://prod.y.uno/sdk-static-bundles-ms/sdk-web/v1.10.6/main.js.
SRI only works with these full-version URLs. The global paths such as
https://sdk-web.y.uno/v1.10/main.js are republished on every patch release, so no hash stays valid for them and none is published.Using NPM package
Validation notes
- Open DevTools Network tab and confirm main.js returns
200from 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 (for example, 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 forawait 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
Shopper-cancelled steps
Some steps render in a modal the shopper can dismiss: the 3DS challenge (closing it with the X or pressing the browser back button), and payment-instruction screens such as vouchers or payment codes. When that happens, the SDK reports:yunoError is emitted for these steps. Dismissing the modal closes the SDK UI, but it does not cancel the payment. The payment stays in flight and is resolved by the provider and by Yuno’s backend. Yuno’s backend remains the source of truth for the final status. A 3DS challenge in particular runs inside the issuer’s own iframe, so the SDK cannot determine whether authentication already completed at the moment the shopper closes the modal. Reporting a terminal cancellation there could contradict a payment that goes on to be approved.
CANCELLED_BY_USER is produced by the SDK to describe the shopper’s gesture. It is not a payment sub-status and does not appear in the Payment status reference.subStatus to detect this case:
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 backDECLINED or ERROR, without restarting the checkout. Instead of tearing down the card form, the SDK keeps it open and surfaces the decline (field-level errors and a top error banner). It also clones the checkout session so the next attempt reuses the same flow.
Retry is disabled by default. Yuno enables it per organization on request through a server-side flag — it is not a Dashboard or Checkout Builder toggle. It is a server-controlled setting, not a startCheckout() argument. It applies to non-enrolled card payments only. Enrolled cards, vaulted cards, and external-button payments are excluded.
Payment retry is supported across all four Web integrations: Seamless, Full Checkout, Lite, and Secure Fields.
Retry in Lite shipped in SDK v1.9.11.
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'andstatusisDECLINEDorERROR): callcontinuePaymentto run the retry. The card form stays open with the decline shown. - Additional action required (
checkout.sdk_action_required === true): callcontinuePaymentso the SDK can show the required screens (for example, 3DS or a redirect). - Nothing left for the SDK to do (status is not
DECLINED/ERRORandcheckout.sdk_action_required === false): the SDK will not tear itself down, so you must unmount it manually withunmountSdk.
Retry lifecycle and callbacks
On a retried attempt the SDK does not fireyunoPaymentResult and does not mount the status page. Instead, it delivers the cloned checkout session to your onLoading callback:
yunoCreatePayment → your backend → continuePayment (or automatic in Seamless) without a yunoPaymentResult callback between attempts. yunoPaymentResult fires only when the flow finishes — either the payment succeeds, the shopper exits, or the payment fails without being retryable.
updateCheckoutSession
updateCheckoutSession(checkoutSession) replaces the active checkout session without unmounting the SDK. Use it to let the shopper switch to a different payment method after a failed payment.
yuno.updateCheckoutSession() automatically propagates to the Secure Fields instance — there is no need to call it on the SF instance directly.Enrollment parameters (full reference)
Parameters forawait yuno.mountEnrollment(). All parameters used in Enrollment flows (Web) are listed here with full detail.
Mount external buttons
Use themountExternalButtons 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:Enrolling payment methods
You can enroll payment methods (store cards for future use) directly during the payment flow by settingpayment_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_tokenthat you can use for future transactions
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. As a result, no vaulting will occur.
For enrollment flows, see Enrollment flows (Web).