# @particle-network/auth-core-modal

> Auth Core provides MPC (Multi-Party Computation)-based threshold signatures.

Latest version **1.5.2** (published 2024-07-29) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @particle-network/auth-core-modal
pnpm add @particle-network/auth-core-modal
yarn add @particle-network/auth-core-modal
bun add @particle-network/auth-core-modal
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.5.2 |
| Published | 2024-07-29 |
| First published | 2023-11-08 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=16 |
| Dependencies | 22 |
| Unpacked size | 15.4 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Particle Network |
| Maintainers | pantaovay, particle-web3 |
| Keywords | ethereum, solana, wallet, blockchain, auth, mpc, particle |

## Links

- npm: https://www.npmjs.com/package/@particle-network/auth-core-modal
- Homepage: https://particle.network
- npm.io page: https://npm.io/package/@particle-network/auth-core-modal

## Dependencies (22)

- [qs](https://npm.io/package/qs.md) ^6.10.3
- [antd](https://npm.io/package/antd.md) ^4
- [uuid](https://npm.io/package/uuid.md) ^8.3.2
- [bn.js](https://npm.io/package/bn.js.md) ^5.2.1
- [dayjs](https://npm.io/package/dayjs.md) ^1.11.7
- [ahooks](https://npm.io/package/ahooks.md) ^3.7.8
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [lzutf8](https://npm.io/package/lzutf8.md) ^0.6.2
- [numbro](https://npm.io/package/numbro.md) ^2.3.6
- [i18next](https://npm.io/package/i18next.md) ^23.2.3
- [json-toy](https://npm.io/package/json-toy.md) ^2.0.2
- [ethjs-unit](https://npm.io/package/ethjs-unit.md) ^0.1.6
- [lottie-react](https://npm.io/package/lottie-react.md) ^2.4.0
- [react-shadow](https://npm.io/package/react-shadow.md) ^20.4.0
- [react-i18next](https://npm.io/package/react-i18next.md) ^13.3.0
- [@solana/spl-token](https://npm.io/package/@solana/spl-token.md) ^0.2.0
- [libphonenumber-js](https://npm.io/package/libphonenumber-js.md) ^1.10.36
- [country-flag-icons](https://npm.io/package/country-flag-icons.md) ^1.4.26
- [react-copy-to-clipboard](https://npm.io/package/react-copy-to-clipboard.md) ^5.1.0
- [@particle-network/wallet](https://npm.io/package/@particle-network/wallet.md) ^1.4.6
- [@particle-network/analytics](https://npm.io/package/@particle-network/analytics.md) ^1.0.1
- [@particle-network/auth-core](https://npm.io/package/@particle-network/auth-core.md) ^1.5.2

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 1.5.2 (latest) — 2024-07-29
- 1.5.2-alpha.2 — 2024-07-26
- 1.5.2-alpha.1 — 2024-07-26
- 1.5.2-alpha.0 — 2024-07-24
- 1.5.1 — 2024-07-01
- 1.5.0 — 2024-06-20
- 1.4.9 — 2024-06-17
- 1.4.8 — 2024-06-12
- 1.4.7 — 2024-06-04
- 1.4.6 — 2024-05-15
- 1.4.5 — 2024-05-07
- 1.4.5-alpha.0 — 2024-05-07
- 1.4.4 — 2024-04-29
- 1.4.3 — 2024-04-26
- 1.4.2 — 2024-04-26
- … 21 more at https://npm.io/package/@particle-network/auth-core-modal/versions

## README

# Particle Auth Core Modal

Auth Core provides MPC (Multi-Party Computation)-based threshold signatures.

Modal is implemented based on React, provides a rich set of hook functions and custom components.

## Installation

Install Auth Core and its peer dependencies.

```shell
npm install @particle-network/auth-core-modal
# or
yarn add @particle-network/auth-core-modal
```

### Configure

Init Auth Core with Particle project config, you can get the config from [Particle Dashboard](https://dashboard.particle.network/).

The modal support custom style, refer to [Customize](https://core-demo.particle.network/customize.html).

Wrap your application with `AuthCoreContextProvider`.

```ts
import { AuthCoreContextProvider } from '@particle-network/auth-core-modal';

const App = () => {
    // replace 'xxxx' with particle project config.
    return (
        <AuthCoreContextProvider
            options={{
                projectId: 'xxxx',
                clientKey: 'xxxx',
                appId: 'xxxx',
            }}
        >
            <YourApp />
        </AuthCoreContextProvider>
    );
};
```

## Connect

Custom you own connect button and call `connect` function to connect Auth Core.

```ts
import { useConnect } from '@particle-network/auth-core-modal';

const { connect, disconnect, connectionStatus, requestConnectCaptcha } = useConnect();

// connect with email.
const userInfo = await connect({
    email: 'xxx@xx.com',
    code: 'xxxxxx', // optional
});

// connect with phone.
const userInfo = await connect({
    phone: '+8618888888888',
    code: 'xxxxxx', // optional
});

// connect with social type.
const userInfo = await connect({
    socialType: 'google',
    prompt: 'select_account', //optional
});

// connect with JWT.
const userInfo = await connect({
    jwt: 'xxxxxxxxxx'
});

// disconnect
await disconnect();
```

## EVM Wallet

EVM Wallet will be created when connect with EVM chains.

```ts
import { useEthereum } from '@particle-network/auth-core-modal';

// you can use eip1193 provider with `web3.js` or `ethers.js`
const { provider,
        address,
        chainId,
        chainInfo,
        switchChain,
        signMessage,
        signTypedData,
        sendTransaction,
        enable } = useEthereum();

// send transaction.
const txHash = await sendTransaction(txData);

// sign message.
const signature = await signMessage(message);
```

## Solana Wallet

```ts
import { useSolana } from '@particle-network/auth-core-modal';

const { address,
        chainId,
        chainInfo,
        switchChain,
        signMessage,
        signTransaction,
        signAllTransactions,
        signAndSendTransaction,
        enable } = useSolana();

// send transaction.
const txHash = await signAndSendTransaction(txData);

// sign message.
const signature = await signMessage(message);
```

## Learn More

- [Website](https://particle.network)
- [Documentation](https://docs.particle.network/)
- [Live Demo](https://core-demo.particle.network/)

---
_Source: https://npm.io/package/@particle-network/auth-core-modal · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
