Skip to main content
WalletKit is the wallet layer our own checkout runs on, published on its own so you can use it anywhere you need a wallet in a browser. It has nothing to do with taking a Reclack payment: reach for it when you need an address, a balance, or a connection of your own.
@reclack/walletkit on npm
  • Any framework. The picker is a custom element, and the connection layer is a plain object with getState and subscribe.
  • One dependency, loaded only when somebody picks a wallet that needs it.
  • Nothing to configure. Endpoints, the wallet catalog and relay pairing ship with working defaults.
  • Typed, and safe to import in a server render.

Quick start

Importing @reclack/walletkit/element defines the tag. With no bundler, point a module script at a CDN instead:
A settlement form with two Reclack elements: a network picker set to Base, and a wallet list showing the wallets this browser exposes with a detected label beside each.A settlement form with two Reclack elements: a network picker set to Base, and a wallet list showing the wallets this browser exposes with a detected label beside each.

The network picker and the wallet picker, inline in a page

If you only need a value and not a component:

Your framework

React, Next.js, Remix

@reclack/walletkit-react on npm
In Next.js, add 'use client' to the file that renders it. Importing @reclack/walletkit itself on the server is fine. Preact needs no second package: the React one works through preact/compat.

Vue

@reclack/walletkit-vue on npm

Angular, Svelte, Solid, plain HTML

No wrapper exists because none is needed. Each binds properties and listens for events on a custom element natively, so use <reclack-connect> directly.

The element

Attributes

For anything an attribute cannot carry, set a property:

Events

All three are composed, so a listener on an ancestor hears them through the shadow boundary. It is connect-error rather than error because error already means a resource failed to load.
The markup lives in a shadow root, so the picker cannot restyle your page and your stylesheet cannot reach into it. Theme it with the attributes below, or by setting any --rkw- token on the element.
variant="modal" is a native <dialog>, so focus trapping, Esc to close, an inert background and a backdrop all come from the browser.

The network picker

The chain something settles on, as a second element. A checkout asks which chain before it asks which wallet, and a form collecting a settlement address asks which chain without connecting anything at all.

The kit

The element makes its own kit and you never have to touch one. Reach for the kit directly when you want wallet state without a picker, or when several pickers should share one.
getState and subscribe are all any framework needs, which is why there are only two wrappers:
Discovering wallets means a window listener and a catalog fetch, so a page with several pickers should share one kit: element.kit = myKit. Themes stay per element, so one kit can serve a light picker in a panel and a dark one in a drawer.

Intent

What you want back from connecting, as a list rather than a mode, because these are not alternatives.
  • address always comes back. Listing it says you want it handed to you.
  • balance needs an asset to be a balance of. Asking without one throws.
  • keepAlive holds the connection open and keeps following account and chain changes. True for a checkout that signs later, false for a form that wanted a value and is done.
A chain is enforced only when you pass chainId. Leave it out when collecting a settlement address: the same address receives on every EVM chain, so asking somebody to switch networks to read it back serves no purpose.

Theming

Twelve tokens, light or dark.
A nested object will not fit in an attribute, so the four values a plain HTML page is most likely to want have one each:
A theme property wins over all four, as does sharing a kit that already carries one. That is deliberate: a checkout that themed its kit should not have to theme every picker inside it as well.

Server rendering

Importing the package on a server is safe: nothing touches window until you create a kit or the element upgrades. Import @reclack/walletkit/element in a client file only, since defining a custom element needs a document.

TypeScript

Types ship with both packages.