# @portkey-v1/did-ui-react

Latest version **1.5.4-alpha.22** (published 2024-02-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install @portkey-v1/did-ui-react
pnpm add @portkey-v1/did-ui-react
yarn add @portkey-v1/did-ui-react
bun add @portkey-v1/did-ui-react
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.5.4-alpha.22 |
| Published | 2024-02-07 |
| First published | 2023-12-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 25 |
| Unpacked size | 2.7 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 9 |
| Maintainers | potterp, yellow.m |
| Keywords | antd, portkey |

## Links

- npm: https://www.npmjs.com/package/@portkey-v1/did-ui-react
- Repository: https://github.com/Portkey-Wallet/portkey-web
- Homepage: https://portkey.finance/
- Issues: https://github.com/Portkey-Wallet/portkey-web/issues
- npm.io page: https://npm.io/package/@portkey-v1/did-ui-react

## Dependencies (25)

- [antd](https://npm.io/package/antd.md) 4.24.14
- [clsx](https://npm.io/package/clsx.md) ^1.2.1
- [uuid](https://npm.io/package/uuid.md) ^8.3.2
- [moment](https://npm.io/package/moment.md) ^2.29.4
- [react-use](https://npm.io/package/react-use.md) ^17.4.0
- [spark-md5](https://npm.io/package/spark-md5.md) ^3.0.2
- [lottie-web](https://npm.io/package/lottie-web.md) 5.9.6
- [antd-mobile](https://npm.io/package/antd-mobile.md) 5.33.0
- [bignumber.js](https://npm.io/package/bignumber.js.md) ^9.1.0
- [query-string](https://npm.io/package/query-string.md) ^7.1.1
- [react-i18next](https://npm.io/package/react-i18next.md) ^11.18.6
- [@portkey-v1/did](https://npm.io/package/@portkey-v1/did.md) ^1.5.4-alpha.22
- [@portkey-v1/types](https://npm.io/package/@portkey-v1/types.md) ^1.5.4-alpha.22
- [@portkey-v1/utils](https://npm.io/package/@portkey-v1/utils.md) ^1.5.4-alpha.22
- [react-qrcode-logo](https://npm.io/package/react-qrcode-logo.md) 2.9.0
- [@portkey-v1/socket](https://npm.io/package/@portkey-v1/socket.md) ^1.5.4-alpha.22
- [@portkey-v1/graphql](https://npm.io/package/@portkey-v1/graphql.md) ^1.5.4-alpha.22
- [@portkey-v1/request](https://npm.io/package/@portkey-v1/request.md) ^1.5.4-alpha.22
- [@portkey-v1/accounts](https://npm.io/package/@portkey-v1/accounts.md) ^1.5.4-alpha.22
- [@portkey-v1/services](https://npm.io/package/@portkey-v1/services.md) ^1.5.4-alpha.22
- [@rc-component/portal](https://npm.io/package/@rc-component/portal.md) 1.0.2
- [@portkey-v1/contracts](https://npm.io/package/@portkey-v1/contracts.md) ^1.5.4-alpha.22
- [@portkey-v1/validator](https://npm.io/package/@portkey-v1/validator.md) ^1.5.4-alpha.22
- [@portkey-v1/onboarding](https://npm.io/package/@portkey-v1/onboarding.md) ^1.5.4-alpha.22
- [@matt-block/react-recaptcha-v2](https://npm.io/package/@matt-block/react-recaptcha-v2.md) ^2.0.0

## Recent versions

- 1.5.4-alpha.22 (latest) — 2024-02-07
- 1.5.4-alpha.21 — 2024-02-05
- 1.5.4-alpha.20 — 2024-02-04
- 1.5.4-alpha.19 — 2024-02-02
- 1.5.4-alpha.18 — 2024-01-30
- 1.5.4-alpha.17 — 2024-01-26
- 1.5.4-alpha.16 — 2024-01-25
- 1.5.4-alpha.15 — 2024-01-23
- 1.5.4-alpha.14 — 2024-01-23
- 1.5.4-alpha.13 — 2024-01-22
- 1.5.4-alpha.12 — 2024-01-22
- 1.5.4-alpha.11 — 2024-01-22
- 1.5.4-alpha.10 — 2024-01-19
- 1.5.4-alpha.9 — 2024-01-19
- 1.5.4-alpha.8 — 2024-01-18
- … 5 more at https://npm.io/package/@portkey-v1/did-ui-react/versions

## README

<p align="center">
  <a href="https://portkeydocs.readthedocs.io/en/pre-release/PortkeyDIDUISDK/index.html">
    <img width="200" src= "https://raw.githubusercontent.com/Portkey-Wallet/portkey-web/master/logo.png"/>
  </a>
</p>

<h1 align="center">@portkey-v1/did-ui-react</h1>

<div align="center">
With Portkey DID SDK, developers can swiftly embed Web3 DID wallet functions while
keeping their original UI.
</div>

<h2>✨ Features </h2>

- 📦 A set of high-quality React components out of the box.
- 🛡 Written in TypeScript with predictable static types.

<h2>📦 Installation</h2>

```bash
npm install "@portkey-v1/did-ui-react"
```

```bash
yarn add "@portkey-v1/did-ui-react"
```

## 🔨 Usage

```tsx
import { SignIn , DIDWalletInfo} from '@portkey-v1/did-ui-react';
import { useState, useEffect, useCallback } from 'react';
import "@portkey-v1/did-ui-react/dist/assets/index.css";

const App = () => {
  const ref = useRef<ISignIn>();

  const onFinish = useCallback((didWallet: DIDWalletInfo) => {
    console.log('didWallet:', didWallet);
  }, []);

  return (
    <PortkeyProvider networkType={'TESTNET'}>
      <button
        onClick={() => {
          ref.current?.setOpen(true);
        }}>
        Sign In
      </button>
      <SignIn ref={ref} onFinish={onFinish} />
    </PortkeyProvider>
  );
};

```

### Customize request

If you use it on applications that don't require cross-domain, like Chrome extensions,
please configure your provider address using ```ConfigProvider.setGlobalConfig```:

```tsx

import { ConfigProvider } from '@portkey-v1/did-ui-react';

ConfigProvider.setGlobalConfig({
  requestDefaults: {
    baseURL: 'http://localhost:3000',
  },
  graphQLUrl: 'http://localhost:3000/graphQL',
});

```

### Customize storage

If you need to customize persistent storage, the default storage is ```localStorage```:

```tsx

export interface IStorageSuite {
  getItem: (key: string) => Promise<any>;
  setItem: (key: string, value: string) => Promise<any>;
  removeItem: (key: string) => Promise<any>;
}

ConfigProvider.setGlobalConfig({
  storageMethod: new IStorageSuite()
})

```

### Example

[Bingogame](https://bingogame-pro.portkey.finance/)

[Bingogame Github](https://github.com/Portkey-Wallet/portkey-bingo-game)

You can also use the ```next-example``` in the current project. [next-example](../next-example/src/pages/sign/index.tsx)

```bash
  yarn next-example dev
```

or

You can also use the ```example``` in the current project. [example](../example/src/index.tsx)

```bash
 yarn example dev
```

### TypeScript

`@portkey-v1/did-ui-react` is written in TypeScript with complete definitions.

## 🤝 Contributing [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)

You can submit any ideas as pull requests or as GitHub issues.
let's build a better antd together.

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