This page documents a legacy SDK. Starting a new integration? Use the Yuno SDK. Already on a legacy SDK? Follow the migration guide.The new Yuno SDK (Web v2.x, iOS v3.x, Android v3.x, React Native v2.x) replaces the Full, Lite, Seamless, Render, Headless, and Secure Fields SDKs with one API across every platform. Legacy SDKs remain supported side by side during the transition and are scheduled for deprecation in 2027. Contact your Account Manager for migration planning.
Step 1: Include the library in your project
Before proceeding with the Lite SDK implementation, see the Quickstart Guide for detailed instructions on how to properly integrate the SDK into your project. The integration guide provides three flexible methods:- Direct HTML script inclusion
- Dynamic JavaScript injection
- NPM module installation
TypeScript LibraryIf you are using TypeScript, Yuno offers a library that provides access to all available methods in the Yuno Web SDK.
Step 2: Initialize SDK with the public key
Initialize the Yuno SDK in your JavaScript application by providing a validPUBLIC_API_KEY:
CredentialsSee the credentials page for more information: /reference/getting-started/authentication
Step 3: Create a customer session
To start the enrollment process, you need to provide thecustomer_session. First, you need to create a customer. Use the Create Customer endpoint to create new customers. In the response, you will receive the customer id, which you use to create the customer session.
After creating the customer, you can create the customer session. Use the customer id and the Create Customer Session endpoint. The customer_session will be provided in the response. You need a new customer_session every time you enroll in a new payment method.
Step 4: Start the enrollment process
Use the configuration below to provide a lite and user-friendly enrollment experience for your customers:mountEnrollmentLite, specify the callbacks to handle enrollment. You can also customize the interface using the texts objects.
Parameters
Configure the lite enrollment with the following options:Status ValuesCommon status values include
ENROLLED, DECLINED, CANCELED, and ERROR.PayPal enrollment with element render mode
Available from Web SDK 1.10.13.
mountEnrollmentLite opens the Yuno modal for PayPal enrollment. The shopper clicks your PayPal button, sees the modal, and has to click PayPal a second time. With element render mode the PayPal button renders directly on your page, and the shopper completes the enrollment in one click.
How it works
Add an empty container to your page, then passrenderMode: { type: 'element', elementSelector } to mountEnrollmentLite. The SDK renders the real PayPal button inside that container and shows a loading skeleton until PayPal finishes loading.
The PayPal button replaces your own button — do not place your button in front of it. If you do not pass renderMode, the modal behavior stays exactly as before.
Integration steps
- Remove your existing PayPal button.
- Add an empty
<div>where the PayPal button should appear. - Pass
renderModewithtype: 'element'and anelementSelectorpointing at that<div>.
width.
Customizing the PayPal button
Optional. PassexternalButtons.paypal to mountEnrollmentLite to style the button, using the same properties as the PayPal express button in checkout. The defaults differ from checkout, so they are listed in full below.
Result
- The shopper clicks the PayPal button, approves in the PayPal popup, and the SDK completes the enrollment.
enrollmentStatusreceives thevaultedTokenwith statusENROLLED.- If the shopper closes the popup,
errorreceivesCANCELED_BY_USER.
KCP KakaoPay and PAYCO enrollment (Web)
KakaoPay desktop enrollment and KCP mobile POST redirects are available from Web SDK 1.11.27. PAYCO desktop enrollment is supported from Web SDK 1.11.43.
KAKAO_PAY) and PAYCO (KCP_PAYCO) enrollment via KCP on desktop browsers, as well as automatic HTTP POST form redirects for KCP enrollment on mobile browsers.
Desktop enrollment flow
On desktop browsers, KakaoPay and PAYCO enrollments render an action button inside the lite enrollment component.How it works
- Script loading & callback setup: When the enrollment component mounts, the SDK declares the KCP callback handler (
window.m_Completepayment), then verifies and loads KCP’s script bundle fromscript_url(https://*.kcp.co.kr). - User action: The shopper clicks the action button. The SDK prepares the order form and opens the KCP authorization window (
KCP_Pay_Execute_Web). - Completion & submission: When the shopper finishes in KCP, KCP calls the SDK’s callback with the result (
res_cd,res_msg,enc_data,enc_info,tran_cd), and the SDK posts it to the backendresult_url(https://*.y.unoor your white-label API host) using a hidden form submission. When configured withRENDER_POPUP, the POST submission occurs within the popup rather than navigating the parent page. - Cleanup: Unmounting the enrollment component closes any open KCP window and restores any pre-existing
window.m_Completepaymenthandler.
Button states and error recovery
- Button disabled: If required backend enrollment configuration (
script_url,form_fields, orresult_url) is missing or targets an unauthorized host, the button is disabled and displays an inline error message. - Script load retry: If KCP scripts fail to load, the button shows an inline error; clicking it loads KCP again, and once loaded, the next click opens KCP.
- Dismissed popup recovery: If the shopper closes the KCP popup without approving, the SDK detects layer removal via DOM mutation observers and re-enables the button for another attempt.
- Timeout recovery: If the browser remains on the page 10 seconds after posting the enrollment result (typically caused by missing CSP form-action policies blocking form submission), the SDK clears the processing state, shows an inline error and re-enables the button so the shopper can retry. Notice that no merchant error callback is fired.
KCP mobile POST redirect
When enrolling via KCP on mobile browsers, the backend returns arequire_action.redirect payload with method: "POST" and init_url targeting a KCP host (*.kcp.co.kr).
The Lite Web SDK automatically detects the POST redirect configuration, builds a hidden form populated with form_fields, appends it to the DOM, and submits the form to navigate the user directly to the provider.
Content Security Policy (CSP) requirements
If your website enforces a strict Content Security Policy (CSP), configure the following directives to allow the KCP scripts, iframe overlays, and form submissions:Step 5: Initiate the enrollment (Required)
After mounting the SDK usingawait yuno.mountEnrollmentLite(), the form will be displayed in the specified element. The user can then proceed with entering their payment method details to complete the enrollment.
Demo AppIn addition to the code examples provided, you can access the Demo App for a complete implementation of Yuno SDKs (clone from the repository).