# @nexeraid/web-onboarding-sdk

> ## Usage To install the Web3 User SDK you need to navigate inside of your client-side application and run the following command:

Latest version **1.0.21** (published 2023-03-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install @nexeraid/web-onboarding-sdk
pnpm add @nexeraid/web-onboarding-sdk
yarn add @nexeraid/web-onboarding-sdk
bun add @nexeraid/web-onboarding-sdk
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.21 |
| Published | 2023-03-23 |
| First published | 2023-02-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 124.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | nexera-protocol |

## Links

- npm: https://www.npmjs.com/package/@nexeraid/web-onboarding-sdk
- npm.io page: https://npm.io/package/@nexeraid/web-onboarding-sdk

## Dependencies (7)

- [axios](https://npm.io/package/axios.md) ^1.3.3
- [dotenv](https://npm.io/package/dotenv.md) ^16.0.3
- [ethers](https://npm.io/package/ethers.md) ^5.7.2
- [clean-publish](https://npm.io/package/clean-publish.md) ^4.1.1
- [@web3auth/base](https://npm.io/package/@web3auth/base.md) ^4.6.0
- [@web3auth/core](https://npm.io/package/@web3auth/core.md) ^4.6.0
- [@web3auth/openlogin-adapter](https://npm.io/package/@web3auth/openlogin-adapter.md) ^4.6.0

## Recent versions

- 1.0.21 (latest) — 2023-03-23
- 1.0.20 — 2023-03-23
- 1.0.19 — 2023-03-23
- 1.0.18 — 2023-03-23
- 1.0.17 — 2023-03-23
- 1.0.16 — 2023-03-23
- 1.0.15 — 2023-03-23
- 1.0.14 — 2023-03-23
- 1.0.13 — 2023-03-23
- 1.0.12 — 2023-03-23
- 1.0.11 — 2023-03-23
- 1.0.10 — 2023-03-23
- 1.0.9 — 2023-03-23
- 1.0.9-dev — 2023-03-23
- 1.0.8-dev — 2023-03-15
- … 9 more at https://npm.io/package/@nexeraid/web-onboarding-sdk/versions

## README

# Nexera Web3 User SDK

## Usage
To install the Web3 User SDK you need to navigate inside of your client-side application and run the following command:

```
yarn add @nexeraid/web-onboarding-sdk
```

### Initialize

```typescript
import { Web3User } from "@nexeraid/web-onboarding-sdk";

const web3User = new Web3User({
  chainId: 80001, // Mumbai
  clientId, // PROVIDE THE CLIENT_ID RECEIVED FROM NEXERA TEAM
  verifier, // PROVIDE THE VERIFIER RECEIVED FROM NEXERA TEAM
  rpc: "https://rpc-mumbai.maticvigil.com" // Mumbai RPC (optional)
})

const web3auth = await web3User.getInstance()
```

### Generate a new Private Key
Generates a new Private Key based on your JWT Token. The Verifier Id Field argument should be included in the jwt token which maps to verifier id, where possible values are `sub` or `email`. Domain argument is the url of your web server (i.e.: `http://localhost:3002/`).

```typescript
const userProvider = await web3User.connect(jwtToken, verifierIdField, domain);
```

### Signing messages
Allows the user to sign a message using their Private Key. The message must have this type.

```typescript
export type TypedDataInput = {
  domain: any,
  message: any,
  types: { SponsoredCallERC2771: any }
}
```

```typescript
const signature = await web3User.sign(msg);
```

### Retrieve PrivateKey
This method reconstructs the Private Key from its Shares and allows the user to retrieve his private key.

```typescript
const privateKey = await web3User.retrievePrivateKey();
```

### Get Address
This method allows the user to retrieve his public address.

```typescript
const address = await web3User.getAddress();
```

### Send transaction
Sign and send a transaction.

```typescript
const txHash = await web3User.sendTransaction(to, data, gasLimit);
```

---
_Source: https://npm.io/package/@nexeraid/web-onboarding-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
