@yuno-payments/sdk-web-types
TypeScript icon, indicating that this package has built-in type declarations

3.1.0 • Public • Published

Using Yuno SDK Types

This package provides TypeScript types for integrating the Yuno SDK into your application. You can use the types in two ways: importing them explicitly or using them globally.

1. Including Types in tsconfig.json

To make the types available globally across your project, include them in your tsconfig.json file:

{
  "compilerOptions": {
    "types": ["@yuno-payments/sdk-web-types/dist/global"]
  }
}

2. How to Use Types in Your Code

a) Importing Specific Types

If you prefer to import specific types explicitly, you can do so like this:

import { YunoInstance } from '@yuno-payments/sdk-web-types'

const yunoInstance: YunoInstance = Yuno.initialize('publicApiKey')

3. What Does the tsconfig.json Configuration Do?

By including "types": ["@yuno-payments/sdk-web-types/dist/global"] in your tsconfig.json, you ensure that global types (like Yuno) are available across your project without the need to import them explicitly.

🚀 Summary

  • To use explicit types, import the specific types you need from @yuno-payments/sdk-web-types.
  • To use Yuno globally, include the configuration in tsconfig.json to make Yuno available throughout your project without importing it.

With this setup, your Yuno SDK integration will be smooth, and TypeScript's type checking and autocompletion will help you ensure correctness in your code.

📝 Version History

SDK v1.1

In version 1.1, all methods in the YunoInstance interface have been updated to return Promises. This change makes the SDK fully asynchronous and allows for better handling of asynchronous operations. The following methods now return Promise<void>:

  • startCheckout
  • mountCheckout
  • mountCheckoutLite
  • mountSeamlessCheckoutLite
  • updateCheckoutSession
  • submitOneTimeTokenForm
  • startPayment
  • continuePayment
  • notifyError
  • mountEnrollmentLite
  • showLoader
  • hideLoader
  • mountFraud
  • mountStatusPayment

Additionally, the secureFields method now returns Promise<SecureFieldInstance>.

These changes enable better async/await support and more consistent error handling across the SDK.

Readme

Keywords

none

Package Sidebar

Install

npm i @yuno-payments/sdk-web-types

Weekly Downloads

2,064

Version

3.1.0

License

ISC

Unpacked Size

39.1 kB

Total Files

4

Last publish

Collaborators

  • yunopayments
  • camilo_yuno
  • miguelchs2