@checkout.com/3ds-web-sdk
v1.0.2
Published
Checkout.com Web SDK for 3-D Secure standalone authentication.
Keywords
Readme
Checkout.com Authentication Browser SDK
Features
- Challenge Window Rendering
- Automatic Issuer Fingerprint Handling
Installation
The Authentication Browser SDK can be installed through NPM:
npm i @checkout.com/3ds-web-sdk
It can also be loaded through the Checkout.com CDN:
<script src="https://authentication-devices.checkout.com/3ds-web-sdk/<version_number>/index.global.js"></script>
To install it as a React component:
npm i @checkout.com/3ds-web-sdk-react
Usage
Create the authentication client. You can find your mssdprefix in your dashboard.
const checkout = await Checkout3DSWebSDK.Checkout3DSWebSDK({ apiBaseUrl: "https://{mssdprefix}.api.checkout.com", environment: "production"});Create the authentication session. The sessionId (prefix: sid_) and sessionSecret (prefix: sek_) allow for client-side interaction with the authentication session.
const session = await checkout.session({ sessionId:"<session_id>", sessionSecret:"<session_secret>" });Authenticate the session. If the authentication is challenged, the challenge window will be attached to the container passed in through the session options container property.
let result = await session.authenticate({ container: '.cko-3ds' });