# react-wovenpay

> wovenpay React SDK for the wovenpay GraphQl api

Latest version **0.1.7** (published 2018-02-20) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.7 |
| Published | 2018-02-20 |
| First published | 2018-02-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | nickmaina |
| Maintainers | wovenpayments |

## Links

- npm: https://www.npmjs.com/package/react-wovenpay
- npm.io page: https://npm.io/package/react-wovenpay

## Dependencies (2)

- [react](https://npm.io/package/react.md) ^16.2.0
- [woven-pay-js](https://npm.io/package/woven-pay-js.md) ^1.0.2

## Recent versions

- 0.1.7 (latest) — 2018-02-20
- 0.1.6 — 2018-02-20
- 0.1.5 — 2018-02-20
- 0.1.4 — 2018-02-20
- 0.1.3 — 2018-02-20
- 0.1.2 — 2018-02-20
- 0.1.1 — 2018-02-20
- 0.1.0 — 2018-02-20

## README

### wovenpay React SDK for the wovenpay GraphQl API

Dependencies:
 - woven-pay-js
 - React

The package contains common queries and a React Component - WovenQuery Component

```javaScript

import WovenQuery from 'react-wovenpay'; 2.3kb
//OR
import WovenQuery from 'react-wovenpay/api/graphql'; 1.2kb

import allBusinesses from 'react-wovenpay/api/queries/business'; 458B

let token = "testtoken" //The Merchant JWT token


<WovenQuery token={token} query={allBusinesses}>
    {({loaded, data}) => {
        if(!loaded){
           return <p>loading...</p>;
        }          
          
        let businesses = data.allBusinesses.edges;
          
        if(loaded && businesses.length ===0){
           return <p>No active business</p>;
        }          
          
        return (
          <div className="App">
            <header className="App-header">              
              <h1 className="App-title">{businesses[0].node.name.toUpperCase()}</h1>
              </header>
          </div>
        );
    }}
</WovenQuery>
```

You can also write custom queries and pass it to the WovenQuery Component

```javaScript
const allBusinessesEmail = `
  query allBusinesses {
    allBusinesses {
      edges {
        node {          
          email
        }
      }
    }
  }
`;
```

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