@ucash/vue
v0.1.3
Published
Vue 3 components and helpers for U.CASH Pay: a Pay-with-U.CASH button + server-side checkout creation. Non-custodial.
Maintainers
Readme
@ucash/vue
Vue 3 components and helpers for U.CASH Pay: a drop-in <UcashPayButton> (pure client-side) plus a server-side checkout helper. Non-custodial.
Install
npm install @ucash/vueThe button (client-side)
<script setup lang="ts">
import { UcashPayButton } from '@ucash/vue';
</script>
<template>
<UcashPayButton
cloud="st_your_store_cloud_token"
:amount="10"
currency="USD"
title="Pro plan"
external-reference="order_123"
redirect-url="https://yoursite.com/thanks"
/>
</template>Opens the hosted U.CASH Pay checkout, where the customer pays with crypto or card. No server call required.
Server-side checkout (transaction-tracked)
import { createUcashCheckout } from '@ucash/vue';
const r = await createUcashCheckout({
cloud: process.env.UCASH_CLOUD_TOKEN!,
amount: '10.00',
currency: 'USD',
externalReference: orderId,
redirectUrl: 'https://yoursite.com/thanks',
});
// redirect the browser to r.payment_urlSet up your pay.u.cash account
- Sign up at pay.u.cash with email + password, then click the verification link in the email.
- Set your receive addresses under Settings -> Addresses (a wallet per coin, or ENS/Unstoppable/FIO names). Crypto settles here.
- Create a store at Account -> Stores -> + Add Store.
- Copy the Store Cloud Token (publishable) and, for webhooks, the Store Webhook Secret. Use the store-level token, not the account-wide one.
- Set the webhook URL (server-side checkout): paste your webhook endpoint into the store's Store Webhook URL field, save, then Test Webhook.
License
MIT.
