@dakota-xyz/cards-js— the framework-free core.@dakota-xyz/cards-js/react— the React binding. It needsreact >= 18.@dakota-xyz/cards-js/styles.css— the default stylesheet.
@dakota-xyz/cards-js (core)
class DakotaCards
The client. Create one per app and reuse it.
class CardDetailsHandle
Controls one card. Get it from cards.cardDetails(...) — you do not construct it yourself.
Events
CardDetailsEvents maps each event name to its payload.
Errors are not delivered as events.
mount() and reveal() reject with a DakotaCardsError, so handle them with try/catch. cardDetails() throws invalid_theme synchronously when a theme value is not concrete.Sessions
Errors
Theming & strings types
@dakota-xyz/cards-js/react
The React entry point re-exports DakotaCards, CardDetailsHandle, and the card types its own signatures use. Import FetchSession, the error types, and the theming types from the core entry point.
<DakotaCardsProvider>
Supplies a DakotaCards client to the component tree.
useDakotaCards()
<CardDetails> and useCardDetails
<CardDetails> renders the .dk-card recipe and exposes reveal and mask through a ref.
<CardDetails> always renders all four value slots and their captions from the .dk-card recipe. fields only selects which of those slots the SDK binds — mounts the masked face into, and reveals. Slots you omit still render, as empty captioned placeholders. To render a genuinely partial layout, with fewer slots on the page, use the headless useCardDetails hook and lay out only the fields you want.
useCardDetails is the headless form: you render the recipe yourself and wire the refs.

