# basqet-react

> Official React package for Basqet

Latest version **1.0.2** (published 2022-08-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install basqet-react
pnpm add basqet-react
yarn add basqet-react
bun add basqet-react
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-08-19 |
| First published | 2022-08-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 18.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | oyeolamilekan |
| Maintainers | quidax-engineering |

## Links

- npm: https://www.npmjs.com/package/basqet-react
- Repository: https://github.com/oyeolamilekan/basqet-react
- Homepage: https://github.com/oyeolamilekan/basqet-react#readme
- Issues: https://github.com/oyeolamilekan/basqet-react/issues
- npm.io page: https://npm.io/package/basqet-react

## Recent versions

- 1.0.2 (latest) — 2022-08-19
- 1.0.1 — 2022-08-11
- 1.0.0 — 2022-08-10

## README

# basqet-react

> Official React package for Basqet

# Basqet React package

Basqet - Allow your customers from anywhere in the world pay you in Bitcoin, QDX, XRP and USDT.

## Demo

![Basqet pay SDK](Demo.png)

## Installation

```sh
npm install basqet-react
```

## Usage

```js
import React from 'react'
import { useBasqet } from 'basqet-react'
// ...
export default function App() {
  const config = {
    email: 'example@gmail.com',
    public_key: 'PUBLIC_KEY',
    amount: '100',
    currency: 'USD',
    metadata: {
      refrence: 'lekan'
    },
    onSuccess: (data: string) => {
      console.log('🚀 onSuccess', data)
    },
    onError: (error) => {
      console.log('🚀 onError', error)
    },
    onClose: () => {
      console.log('🚀 onClose: SDK closed')
    },
    onAbandoned: () => {
      console.log('🚀 onClose: SDK closed')
    }
  }

  const handlePayment = useBasqet(config)
  return (
    <div className='App'>
      <h1>Basqet SDK</h1>
      <button onClick={handlePayment}>Pay with Basqet</button>
    </div>
  )
}
```

## Configuration Options

- [`public_key`](#public_key)
- [`email`](#email)
- [`amount`](#amount)
- [`onSuccess`](#onSuccess)
- [`onError`](#onError)
- [`onClose`](#onClose)
- [`onAbandoned`](#onAbandoned)
- [`metadata`](#metadata)

### <a name="public_key"></a> `public_key`

**string: Required**
Your public key can be found on your [dashboard](https://dashboard.basqet.com/).

### <a name="email"></a> `email`

**string: Required**
The user's email address

### <a name="amount"></a> `amount`

**string | number: Required**
The amount you intend to send in kobo

### <a name="onSuccess"></a> `onSuccess`

**(response) => void: Required**
This is called when a transaction is successfully. It returns an object as a response with the transaction details.

Check the [Basqet Docs](https://docs.basqet.com/docs) for response object

### <a name="onError"></a> `onError`

**(response) => void: Optional**
This is called when a transaction fails. It returns a response with error type

Check the [Basqet Docs](https://docs.basqet.com/docs) for error object

### <a name="onClose"></a> `onClose`

**(response) => void: Optional**
This is called when the SDK has been closed.

### <a name="onAbandoned"></a> `onAbandoned`

**(response) => void: Optional**
This is called when a user clicks on the close button.

### <a name="metadata"></a> `metadata`

**object: Optional**
This object should contain additional/optional attributes you would like to have in your transaction response

## Support

If you're having trouble with Basqet React package please reach out to oye at <jolalekan@quidax.com> or me <adegbitebidmus@gmail.com> if you have issues with your integration. We're more than happy to help you out.

## Basqet API References

- [Basqet API Docs](https://docs.basqet.com/docs)
- [Basqet Dashboard](https://dashboard.basqet.com/)

## License

[MIT](https://github.com/kamsy/basqet-react/blob/master/LICENSE) for more information.

---
_Source: https://npm.io/package/basqet-react · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
