Installation
Add the Yuno Web SDK to your page via script tag or npm.- Script Tag
- npm
Initialization
Initialize the SDK before mounting any checkout component. Pass your public API key as a string:Initialization Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
publicApiKey | string | Yes | Your Yuno public API key from Dashboard > API Keys. Passed as the first positional argument (string, not object) |
Seamless Checkout Configuration
Start Seamless Checkout by passing a configuration object with all options.Checkout Configuration Properties
| Property | Type | Required | Description |
|---|---|---|---|
checkoutSession | string | Yes | Checkout session ID from the Create Checkout Session API |
elementSelector | string | Yes | CSS selector for the container element (e.g., "#root") |
countryCode | string | Yes | ISO 3166-1 alpha-2 country code |
language | string | No | UI language override: "en", "es", "pt" |
showLoading | boolean | No | Show loading indicator during SDK operations. Default: true |
issuersFormEnable | boolean | No | Display bank/issuer selection dropdown for methods that require it. Default: false |
showPaymentStatus | boolean | No | Show payment status screen after completion. Default: true |
renderMode | object | No | Controls how the checkout form renders. See Render Modes |
card | object | No | Card form configuration. See Card Form Options |
Callbacks
yunoCreatePayment(oneTimeToken, tokenWithInformation)
Called when the customer submits payment and Yuno generates a one-time token. Use this to create the payment on your server, then callyuno.continuePayment().
| Parameter | Type | Description |
|---|---|---|
oneTimeToken | string | Single-use token to pass to the Create Payment API |
tokenWithInformation | object | Token with additional metadata (payment method type, last four digits, brand) |
yunoPaymentResult(paymentResult)
Called with the final payment outcome after the flow completes.yunoPaymentMethodSelected(data)
Fires when the user selects a payment method.yunoError(error)
Called when the SDK encounters an error.onLoading(isLoading)
Reports loading state changes during SDK operations.Render Modes
Control how the checkout form appears in the page.Modal
The checkout form opens in an overlay modal on top of your page.Element (Inline)
The checkout form renders inline within a specified container.| Property | Type | Required | Description |
|---|---|---|---|
type | "modal" | "element" | Yes | Render mode |
elementSelector | string | Only for "element" | CSS selector for the inline container |
Card Form Options
Configure the card payment form behavior and appearance.Card Properties
| Property | Type | Default | Description |
|---|---|---|---|
type | "extends" | "card" | "cardNumber" | "cardExpiry" | "cardCvv" | "extends" | Card form type. "extends" renders the full card form. Individual types render standalone fields |
cardSaveEnable | boolean | false | Show a “Save card for future payments” checkbox |
styles | object | . | CSS customization object for card fields. Supports base, focus, error, valid states |
texts | object | . | Custom label overrides for card form fields |
cardNumberPlaceholder | string | "Card number" | Placeholder text for the card number field |
expiryPlaceholder | string | "MM/YY" | Placeholder text for the expiry field |
cvvPlaceholder | string | "CVV" | Placeholder text for the CVV field |
hideCardholderName | boolean | false | Hide the cardholder name field |
isCreditCardProcessingOnly | boolean | false | Show only credit cards, hiding debit card options |
onChange(event) | function | . | Callback fired when any card field value changes |
Card Field Types
Use individual field types to render standalone, embeddable card inputs:| Type | Description |
|---|---|
"card" | Complete card form (number, expiry, CVV, name) |
"cardNumber" | Card number field only |
"cardExpiry" | Expiry date field only |
"cardCvv" | CVV/CVC field only |
"extends" | Extended card form integrated into checkout |
Seamless Flow Methods
mountSeamlessCheckout
Mount the checkout form for a specific payment method after the customer selects one.| Parameter | Type | Required | Description |
|---|---|---|---|
paymentMethodType | string | Yes | Payment method type (e.g., "CARD", "PIX", "PSE") |
vaultedToken | string | No | Vaulted token for returning customers with saved payment methods |
startPayment
Trigger the payment after the customer has filled in the form.continuePayment
Continue the payment flow after creating the payment on your server. Call this insideyunoCreatePayment.
| Parameter | Type | Required | Description |
|---|---|---|---|
showPaymentStatus | boolean | No | Show the payment status screen after completion |
External Buttons
Mount Apple Pay and Google Pay buttons outside the main checkout form.mountExternalButtons
Render wallet payment buttons in specified containers.unmountExternalButton
Remove a specific external payment button.| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Payment method type to remove ("APPLE_PAY", "GOOGLE_PAY") |
unmountAllExternalButtons
Remove all mounted external payment buttons.Enrollment
Use the SDK to enroll (vault) payment methods for returning customers.Enrollment Statuses
| Status | Description |
|---|---|
CREATED | Enrollment session created |
READY_TO_ENROLL | Customer has submitted card details, ready to enroll |
ENROLLED | Card successfully enrolled and vaulted |
ENROLL_FAILED | Enrollment attempt failed |
EXPIRED | Enrollment session expired before completion |
REJECTED | Enrollment rejected by the provider |
DECLINED | Enrollment declined |
UNENROLLED | Previously enrolled card has been removed |
TypeScript Support
The Yuno Web SDK includes TypeScript type definitions. Import types directly:| Type | Description |
|---|---|
StartCheckoutArgs | Configuration for startCheckout() (checkoutSession, countryCode, callbacks, etc.) |
SeamlessCheckoutConfig | Seamless checkout startup configuration |
OneTimeToken | One-time token with payment method metadata |
CardOptions | Card form configuration options |
RenderMode | Render mode configuration ("modal" or "element") |
Subresource Integrity (SRI)
When loading the SDK via script tag, use SRI to ensure the script has not been tampered with:Complete Initialization Example
A full example with all configuration options:Next Steps
Full Checkout
Pre-built UI with zero payment method management.
Seamless Checkout
Control payment method selection with SDK convenience.
Customization
Theme and style your checkout.
Card Enrollment
Vault cards for returning customers.