open-index/open-npm huggingface dataset:
npm package: @particle-network/auth-core
Description: ## Start
Author: Particle Network
Latest version: 3.0.0-alpha.2

# Particle Auth Core

## Start

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

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

particleAuth.init({
    projectId: string;
    clientKey: string;
    appId: string;
});
```

## Connect

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

const userInfo = await connect({
  email: 'xxx',
  code: 'xx',
});
```

## Learn More

- [Website](https://particle.network)
- [Documentation](https://docs.particle.network/)
- [Live Demo](https://core-demo.particle.network/)
npm package: @particle-network/auth-core-modal
Description: Auth Core provides MPC (Multi-Party Computation)-based threshold signatures.
Author: Particle Network
Latest version: 1.5.2

# 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/)
npm package: @particle-network/authkit
Description: Auth Core provides MPC (Multi-Party Computation)-based threshold signatures.
Author: Particle Network
Latest version: 3.0.0-alpha.5

# 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/authkit
# or
yarn add @particle-network/authkit
```

### 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/authkit';

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/authkit';

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/authkit';

// 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/authkit';

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/)