@dakota-xyz/cards-js securely displays full card details — PAN, CVV, and expiry — directly in your web app, without the sensitive data ever touching your DOM, your servers, or your code.
Card values render inside frames served by Dakota’s card-data processor. Your page positions and styles those frames but can never read them, so integrating Cards.js keeps your web front end within PCI DSS SAQ A scope. Your backend mints a session, and the browser consumes it once, for a bounded reveal window.
- Framework-free core — a small imperative client, no framework required.
- First-class React binding — components and hooks under
@dakota-xyz/cards-js/react. - Deliberate reveal — single-use sessions, an auto-masking reveal window, and an SDK-enforced re-mask.
- Themeable — a default card face you can restyle with CSS custom properties, plus per-field text styling that carries into the revealed value frames.
Install
react >= 18). You only need it for the /react entry point.
Quickstart — vanilla
Your backend exposes one endpoint that mints a reveal session — see the integration guide. The browser calls it throughfetchSession:
.dk-card HTML recipe — see theming. mount() only paints the masked face and never touches the network. reveal() is what mints a session and swaps in the processor-hosted fields.
Quickstart — React
<CardDetails> renders the .dk-card recipe for you. To own the markup yourself, use the useCardDetails hook: it returns field refs and live state, so you can render the recipe by hand.
Styles
Import the default stylesheet once, anywhere in your app:theme option — see theming.
Browser support
The page hosting a reveal must be served over HTTPS (a secure context), in local development too. See Network & CSP.
Privacy & telemetry
Cards.js ships no analytics or error reporting, and never logs session tokens. See Security.Documentation
Integration guide
The
fetchSession contract, session behaviour, error handling, and multiple cards.API reference
Every exported type, class, component, and hook.
Theming
The DOM recipe, custom properties,
theme, and i18n.Network & CSP
The Content-Security-Policy directives to allow.
Security
How card data stays out of your reach, and how to report a vulnerability.
Changelog
Notable changes, per version.

