Additional resources
- Yuno offers a TypeScript library that complements the SDK.
- See Choose the right integration for you if you’re unsure which flow to follow.
- See the Demo App for a complete implementation (clone from the repository).
Requirements
- A customer created in Yuno and a checkout session: reference each API when setting up your backend.
- Public API key (obtain from the Yuno Dashboard → Developers > Credentials)
- Direct HTML script inclusion: Add the script tag to your page.
- Dynamic JavaScript injection: Load the SDK at runtime.
- NPM module installation: Install via npm (recommended).
loadScript method to handle script loading with Subresource Integrity (SRI) support:
Find the latest SRI hashes for each version in the yuno-sdk-web repository.
Parameters
These are the parameters covered in this guide. For the full list of parameters and callbacks, see the Web SDK Common Reference.| Parameter | Description |
|---|---|
checkoutSession | Checkout session ID from your backend (Create checkout session API). Required for all flows. |
elementSelector | CSS selector for the element where the SDK mounts (e.g. #root). |
countryCode | ISO country code where the payment runs (e.g. FR, US). |
language | Language code for the UI (e.g. fr-FR, ar). Optional; defaults to browser language when available. |
showLoading | Show SDK loading spinner. Optional. |
showPaymentStatus | Show payment result screen. Optional. |
yunoCreatePayment(oneTimeToken) | Callback: send one-time token to your backend to create the payment; then call yuno.continuePayment(). |
yunoPaymentResult(status) | Callback: payment finished. Receives payment status (e.g. SUCCEEDED, DECLINED, PENDING). |
yunoError(message, data) | Callback: error during the flow. |
onLoading | Callback: loading state updates. |
card | Card form options (e.g. onChange, isCreditCardProcessingOnly). Optional. |
full-checkout
Implement Yuno’s Full integration: pre-built checkout UI with full control over branding, forms, and flow. Use this when you want Yuno to render the checkout experience while you manage customer and checkout session creation on your backend.Step 1: Include the library in your project
Follow the steps in Include the library in your project above.Step 2: Initialize the SDK
After including the library (step 1), initialize the SDK. See Quickstart guide for initialization.Step 3: Start the checkout process
Use theyuno.startCheckout function to start the checkout process with the necessary parameters.
See Parameters for all options. For styling, themes, and additional configurations, see SDK customizations.
onPaymentMethodSelected triggers when the customer chooses the payment method (before the payment flow begins). Define onPaymentMethodSelected in startCheckout before mountCheckout. For PayPal, the payment sheet opens immediately after selection—no extra confirmation click required.
Step 4: Mount the SDK
Display the payment methods:Step 5: Initiate the payment process
Callyuno.startPayment() to initiate the payment flow after the user selects a payment method:
Step 6: Get the OTT (one-time token)
After the customer fills out the requested data in Yuno’s payment forms, the SDK provides the one-time token. The configuration functionyunoCreatePayment(oneTimeToken) is then triggered with the one-time token.
tokenWithInformation to receive additional information provided by the customer in the checkout, such as installments or document type/number:
Step 7: Create the payment
Create a payment using the Create Payment endpoint. The merchant’s backend should call this endpoint to create the payment in Yuno using the one-time token and checkout session. After Step 6, the basic payment flow is implemented. Test using the checkout session and one-time token. For additional features, see Complementary features. Required: After creating a payment, integrate thecontinuePayment method. When the API response sets sdk_action_required to true, call yuno.continuePayment() to present the necessary screens.
continuePayment return value or null
For payment methods that require merchant-side action (e.g., when the payment provider requires a redirect URL in a webview), the await yuno.continuePayment() method returns either an object with the following structure or null: