# react-argyle-link

> A React component for Argyle Link

Latest version **1.1.1** (published 2021-07-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-argyle-link
pnpm add react-argyle-link
yarn add react-argyle-link
bun add react-argyle-link
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2021-07-01 |
| First published | 2021-06-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 8.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Ilya Khrustalev |
| Maintainers | ikhrustalev |
| Keywords | react, react-component, argyle |

## Links

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

## Dependencies (1)

- [react-script-hook](https://npm.io/package/react-script-hook.md) ^1.4.1

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2021-07-01
- 1.1.0 — 2021-06-30
- 1.0.2 — 2021-06-29
- 1.0.1 — 2021-06-29
- 1.0.0 — 2021-06-29

## README

# react-argyle-link - [![npm version](https://badge.fury.io/js/react-argyle-link.svg)](http://badge.fury.io/js/react-plaid-link)

> A React component for [Argyle Link](https://argyle.com/docs/argyle-link)

## Getting Started

- `yarn add react-argyle-link` or `npm install react-argyle-link`;
- Your application will aso need `react-dom` and `react` installed.

## How to use

### Argyle Link Button with styling

```typescript jsx
import React from 'react';
import ReactDOM from 'react-dom';
import { ArgyleLink } from './ArgyleLink';

ReactDOM.render(
  <ArgyleLink
    style={{
      padding: '8px 32px',
      borderRadius: 4,
      fontSize: 20,
      fontWeight: 'bold',
      backgroundColor: 'black',
      color: '#fff',
      border: 'none',
      cursor: 'pointer',
    }}

    options={{
      pluginKey: '<your-plugin-key>',
      onAccountCreated: params => console.log('Account created: ', params),
      onAccountConnected: params => console.log('Account connected: ', params),
      onAccountUpdated: params => console.log('Account updated: ', params),
      onAccountRemoved: params => console.log('Account removed: ', params),
      onUserCreated: params => console.log('User created: ', params),
      onClose: () => console.log('Link closed'),
      onTokenExpired: params => console.log('Token expired: ', params),
    }}
  >
    Connect Account
  </ArgyleLink>,
  document.getElementById('root')
);
```

### useArgyleLink hook inside function component

```typescript jsx

import React from 'react';
import ReactDOM from 'react-dom';
import { useArgyleLink } from './ArgyleLink';

const App = () => {
  const { error, ready, open, close } = useArgyleLink({
    pluginKey: '<your-plugin-key>',
    onAccountCreated: params => console.log('Account created: ', params),
    onAccountConnected: params => console.log('Account connected: ', params),
    onAccountUpdated: params => console.log('Account updated: ', params),
    onAccountRemoved: params => console.log('Account removed: ', params),
    onUserCreated: params => console.log('User created: ', params),
    onClose: () => console.log('Link closed'),
    onTokenExpired: params => console.log('Token expired: ', params),
  });

  return (
    <>
      {error && <div style={{ color: 'red' }}>{error}</div>}
      <button disabled={!!error} onClick={() => open()}>Connect Account</button>
    </>
  );
};

ReactDOM.render(<App />, document.getElementById('root'));
```

## Parameters

Please refer to [original documentation](https://argyle.com/docs/argyle-link/configuration) for details.

|    param     |   type   |   is required?    |
|:------------:|:--------:|:-----------------:|
|   pluginKey  |  string  |      Required     |
|    apiHost   |  string  |      Optional     |
|   userToken  |  string  |      Optional     |
|   linkItems  | string[] |      Optional     |
|      on*     | function |      Optional     |

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