Show card details
The card viewer draws each card field in a secure frame on your page. Your backend requests a short-lived card token, and your page passes it to the viewer unchanged. The card number, expiration date and CVV never pass through your servers or your page’s DOM.
Request a card token
From your backend, read the card with extend=cardToken. The key needs cards:read, and the card must be ACTIVE. A platform key sends Account-Holder with the card’s account holder ID; a company key does not. Set API_HOST to the API domain assigned to your integration.
Send only the response’s cardToken object to your page, and only to a user who may see this card’s details. Treat it as opaque:
- Pass it to the viewer exactly as the API returned it.
- Request a new one each time you show the card. It stops working at
expiresAt. - Do not store it, log it or put it in a URL.
Load the viewer
Load the viewer with the @outpave/outpave-js npm package or a script tag. Replace APP_HOST with the domain of the web app assigned to your integration. Both load it over HTTPS from this address rather than a copy, so your page receives fixes.
The package adds TypeScript types. loadEmbedded resolves null where there is no window, such as during server rendering, so call it in the browser.
Options
Copying
Depending on the card’s program, the viewer adds a copy button beside the card number or copies a field when the user clicks it. onCopy reports the field either way.
Layout
The viewer adds this structure to container. Style the rows and labels with your own CSS through its attributes; style the card fields themselves with style.
aria-busy is true until the fields show.