# idriss-react

> IDriss react hooks

Latest version **1.0.5** (published 2022-12-06) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2022-12-06 |
| First published | 2022-12-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Miles Gray |
| Maintainers | milesgray |
| Keywords | react, idriss, web3 |

## Links

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

## 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.0.5 (latest) — 2022-12-06
- 1.0.4 — 2022-12-06
- 1.0.3 — 2022-12-06
- 1.0.2 — 2022-12-06
- 1.0.1 — 2022-12-06
- 1.0.0 — 2022-12-05

## README

# idriss-react

[IDriss](https://www.idriss.xyz/) React hooks

## Install

```bash
npm install idriss-react
```

## Features

This is a simple wrapper around [idriss-crypto](https://github.com/idriss-crypto/ts-library) and [wagmi](https://github.com/wagmi-dev/wagmi) that offers React-style hook abstractions.  The following functionality is available:

**IDriss Book** - decentralized mapping of emails, phone numbers and Twitter usernames to wallet addresses

1. Resolving *TODO* (available in [idriss-crypto](https://github.com/idriss-crypto/ts-library))
2. [Reverse resolving](#useTwitterHandle)
3. Registering new records *TODO* (available in [idriss-crypto](https://github.com/idriss-crypto/ts-library))

**IDriss Send** - mass web3 onboarding & asset distribution tool

4. Sending crypto & NFTs to emails, phone numbers, and Twitter usernames *TODO* (available in [idriss-crypto](https://github.com/idriss-crypto/ts-library.git))

## useTwitterHandle

We use wagmi to automatically return the connected wallet address to a twitter handle, if the user has signed up with IDriss.
If the user has not signed up, `accountTwitterHandle` will be null.

```js
import { WagmiConfig, createClient } from 'wagmi';
import { getDefaultProvider } from 'ethers';

const client = createClient({
  autoConnect: true,
  provider: getDefaultProvider(),
})

function App() {
  return (
    <WagmiConfig client={client}>
      <Profile />
    </WagmiConfig>
  )
}
```

```js
import { useAccountTwitterHandle } from 'idriss-react';
import { useAccount } from 'wagmi';

function Profile() {
  const { address } = useAccount();
  const { accountTwitterHandle, isSuccess, isError } = useTwitterHandle();

  if (address)
    return (
      <div>
        {isSuccess && (
          <p>
            Welcome, {accountTwitterHandle}
          </p>
        )}
        Connected to {address}
      </div>
    )
}
```

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