tds_session_id, and react to success, failure, or technical errors through callbacks.
Create a 3DS Element
Create the element once with callbacks, then callmount(sessionId) whenever you need to authenticate.
Options
Callback Semantics
| Callback | Meaning | Typical action |
|---|---|---|
onReady | Challenge UI is rendered and ready | Hide loading placeholders |
onSuccess | Authentication completed successfully | Call backend to confirm/finalize payment |
onFailure | Authentication was attempted but failed | Show retry CTA and create a new session |
onError | Technical error (component/network/runtime) | Show fallback path and log diagnostics |
colorScheme
UsecolorScheme to align the 3DS iframe root with your page theme.
Theme
theme supports preset strings (clean, minimal, material) and function themes.
If you pass
theme as an object, the 3DS component currently uses the preset value.Full Theme Example
3DS challenge copy and issuer-controlled challenge UI cannot be fully restyled. Use
theme, size, and colorScheme to style the container experience around it.Mount Behavior
mount(sessionId)requires a non-empty session ID.- If you mount again with a new session ID, the SDK cleans up the previous instance automatically.
- Callbacks from options are automatically wired for each mount.
Backend Contract
Use the frontend 3DS element as an authentication step between your backend session creation and transaction confirmation.Create a 3DS session on your backend
Return both session IDs from your backend:
tds_session_idforthreeDSecure.mount(...)in the frontendidforthree_d_secure_session_idin backend transaction create/authenticate calls
POST /v1/3ds-sessions(self)POST /v1/merchants/{merchantId}/3ds-sessions(organization on behalf of merchant)
Mount the 3DS element
In practice, sessions come back as
ACTION_REQUIRED or FAILED at creation — even frictionless authentication completes through the SDK element. The API contract allows AUTHENTICATED as a creation-time response for forward compatibility, so always branch on all three statuses.FAILED: the card was rejected before the flow could start — surface the error and let the user retry.AUTHENTICATED: authentication already completed — skip mounting and proceed to payment confirmation.ACTION_REQUIRED: mount withtds_session_id. The SDK runs the full 3DS flow internally.
- Frictionless: the issuer authenticates the transaction silently in the background. No challenge UI is shown.
onSuccessfires automatically. - Challenge: the issuer presents a verification step inside the element.
onSuccessfires after the user completes it.
Modal vs Embedded
- Modal (Default)
- Embedded
Mount Errors
Unmount
Common Failure Handling
locale applies to SDK/component messages. Issuer-hosted challenge copy is controlled by the card issuer.
