Skip to main content
The Reveal Card widget allows you to securely display sensitive card information — card number (PAN), security code (CVV), and expiration date — directly in your application. All sensitive data is fetched and rendered in an isolated iframe, helping reduce your PCI scope.
The <card-reveal-widget> element has been renamed to <reveal-card>. The old element name continues to work via a backwards-compatible alias but will be removed in a future major version. Please update your integration to use <reveal-card>.
Reveal Card Front
Reveal Card Back

Step 1: Load the Widget Script

Load the Reveal Card widget script into your page:

Step 2: Get a Widget Token

Request a widget token for revealing card details:
Widget tokens expire after 5 minutes and are scoped to a specific card. Generate a new token on each page load or when the user initiates a new reveal action.

Step 3: Add the Widget Component

Add the <reveal-card> web component to your page:

Configuration Options

Card Side and Form

The widget renders a visual card with front and back views:

Built-in Toggle

Set show-toggle to render a toggle switch below the card that triggers the card reveal:

Custom Labels

Customize the labels displayed in the widget:
Available custom label keys:
  • panLabel - Card number label (back side)
  • cvvLabel - CVV label (back side)
  • expiryLabel - Expiration date label (back side)
  • retryButtonText - Error state retry button text
  • toggleLabel - Built-in toggle label text
  • cardholderPlaceholder - Placeholder text when emboss-name is empty

Event Handling

The widget dispatches events for both initialization and card reveal outcomes:
  • load — The widget finished initializing and is ready to use.
  • error — The widget failed to initialize (network/CSP failure or handshake timeout).
  • success — Card details retrieved successfully.
  • failure — Card reveal failed (API error, timeout, etc.).
  • copy — A card field value was copied to the clipboard.
You can subscribe with addEventListener or by assigning the matching callback property:

Load Event

Dispatched once when the widget has finished initializing and is ready to use. Use this to reveal the widget UI only after it’s ready, or to dismiss a loading placeholder. Fires exactly once per iframe lifecycle.

Error Event

Dispatched once when the widget fails to initialize — either because the underlying iframe could not load (network failure, blocked by Content Security Policy, etc.) or because the iframe loaded but never completed its handshake within 5 seconds. This is distinct from the failure event, which signals that a card reveal API call failed after the widget was already running.

Success Event

Dispatched when card details are successfully retrieved and rendered inside the widget’s secure iframe. Sensitive card data (PAN, CVV, expiration) is never exposed to the host page.

Failure Event

Dispatched when the card reveal API call fails.

Copy Event

Dispatched when a user copies a card field value (card number, security code, or expiration) to the clipboard using the copy buttons inside the widget. The actual clipboard operation happens within the secure iframe — no PCI data is exposed in the event.

Public Methods

The widget exposes methods for programmatic control. These are useful when you want to control the reveal behavior externally instead of using the built-in toggle.

Complete Example


Migration from card-reveal-widget

The Reveal Card widget was previously named <card-reveal-widget>. It has been renamed to <reveal-card> for consistency with the other Synctera widgets (<activate-card>, <set-pin>).

What changed

  1. CDN URL: The script URL changed from widgets/card-reveal/v1.0.0/index.js to widgets/reveal-card/v1.1.1/index.js
  2. Element name: The custom element changed from <card-reveal-widget> to <reveal-card>
  3. Existing public methods and events are unchanged (requestCardReveal(), toggleCardSide(), setCardSide(), refresh(), success, failure, copy)
  4. New initialization events: <reveal-card> adds load and error events (plus matching onLoad / onError callback properties) so you can react to the widget becoming ready or failing to initialize — see Event Handling. These events are additive and existing integrations continue to work without changes.

Backwards compatibility

The new widget script registers both <reveal-card> (recommended) and <card-reveal-widget> (deprecated alias). If you load the new CDN URL, your existing <card-reveal-widget> elements will continue to work, but a deprecation warning will be logged to the browser console.

Migration steps

  1. Update the script tag to use the new CDN URL
  2. Replace <card-reveal-widget> with <reveal-card> in your HTML
  3. Update any document.querySelector('card-reveal-widget') or document.createElement('card-reveal-widget') calls
The old CDN URL (widgets/card-reveal/v1.0.0/index.js) is frozen and will not receive updates. Switch to the new URL to receive future improvements and fixes.