Skip to main content
Cards is available in sandbox only while we finish development. Dakota enables Cards per account. The Cards endpoints are in the API reference, marked Sandbox only. Endpoints, fields, and flows can still change before release.
@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.
For how card data stays out of Dakota’s REST API, and the endpoint your backend calls, see Secure card data.

Install

React is an optional peer dependency (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 through fetchSession:
The mount targets live inside the documented .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:
It ships the Dakota card face — a black card with the DAKOTA wordmark, the card-network mark, and a textured accent — and self-hosts its fonts inside the package, so rendering the face makes no third-party requests. Restyle it with CSS custom properties or the 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.

License

MIT © Dakota