Skip to content

Getting Started

Filip Lauc edited this page Apr 20, 2021 · 2 revisions

Crypto Checkout is a webcomponent, this makes it easier to integrate with any framework you're using.

First install the library.

npm i --save @jaspero/crypto-checkout

Then import it in to your project along with any coin you want to use. Here as an example we're only setting up btc.

import {btc, init} from '@jaspero/crypto-checkout';

Set the wallet property on btc to your wallet address.

btc.wallet = 'my-address';

IMPORTANT: Don't forget to set the wallet address!

Now initiate the library, passing in btc (you can forward any number of coins).

const crypto = init([btc, eth, ltc, bch, bsv, xmr]);

To open the checkout flow, simply call the open method passing in a value (price in USD) and optionally a message (this is attached to the transaction when provided).

crypto.open({value: 1, message: 'crypto-checkout-demo'})
Clone this wiki locally