# @zokshpay/sdk-react

> Wrapper on top of generic zokshpay embed.js to enable easy integration

Latest version **0.2.0** (published 2023-03-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install @zokshpay/sdk-react
pnpm add @zokshpay/sdk-react
yarn add @zokshpay/sdk-react
bun add @zokshpay/sdk-react
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2023-03-15 |
| First published | 2023-01-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 19.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ashish Rana |
| Maintainers | kamal.moopay |
| Keywords | crypto-payments, crypto, moopay, zoksh |

## Links

- npm: https://www.npmjs.com/package/@zokshpay/sdk-react
- Repository: https://github.com/Zokshpay/sdk-react
- Homepage: https://github.com/Zokshpay/sdk-react#readme
- Issues: https://github.com/Zokshpay/sdk-react/issues
- npm.io page: https://npm.io/package/@zokshpay/sdk-react

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2023-03-15
- 0.1.9 — 2023-03-15
- 0.1.7 — 2023-03-10
- 0.1.6 — 2023-01-31
- 0.1.5 — 2023-01-31
- 0.1.4 — 2023-01-31
- 0.1.3 — 2023-01-31
- 0.1.2 — 2023-01-31
- 0.1.1 — 2023-01-30

## README

# sdk-react

React wrapper on latest zoksh embed.js for easy, secure and up-to-date integration.

## Usage example

```js
import { useZoksh } from './useZoksh';

export const Example = () => {
  const { status, addEventHandler, initOrder } = useZoksh({
    environment: 'test',
  });

  const initHandler = useCallback(() => {
    console.log('payment init');
  }, [status]);

  const validatedHandler = useCallback(() => {
    console.log('payment validated');
  }, [status]);

  useEffect(() => {
    if (status === 'ready') {
      addEventHandler({ event: 'payment-init', handler: initHandler });
      addEventHandler({ event: 'payment-validated', handler: validatedHandler });

      initOrder('821uosadfnq230aa822nc');
    }
  }, [status, addEventHandler]);

  return (
    <>
      <p>{`Current status: ${status}`}</p>
      {status === 'ready' && <p>You can use the script here.</p>}
    </>
  );
};
```

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