@ucash/preact
v0.1.1
Published
Preact components and helpers for U.CASH Pay: a Pay-with-U.CASH button + server-side checkout creation. Non-custodial.
Downloads
50
Maintainers
Readme
@ucash/preact
Preact components and helpers for U.CASH Pay: a Pay-with-U.CASH button plus a server-side checkout helper. Accept crypto + cards. Non-custodial.
Install
npm install @ucash/preact preactUse
import { UcashPayButton, hostedCheckoutUrl, createUcashCheckout } from '@ucash/preact';
// Client-side button (cloud token is publishable):
<UcashPayButton cloud="YOUR_CLOUD_TOKEN" amount="10" currency="USD" title="Pro plan" />
// Or just the URL:
hostedCheckoutUrl({ cloud, amount, currency, title, externalReference, redirectUrl });
// Server-side tracked checkout:
const r = await createUcashCheckout({ cloud: process.env.UCASH_CLOUD_TOKEN, amount: '10', externalReference: 'order-123' });Set up your pay.u.cash account
- Sign up at pay.u.cash, click the verification email link.
- Set receive addresses under Settings -> Addresses (raw, ENS, UD, or FIO).
- Create a store under Account -> Stores, copy its Store Cloud Token.
- For cards, connect your own Stripe under Settings -> Payment processors.
License: MIT.
