# bnc-onboard

> Onboard users to web3 by allowing them to select a wallet, get that wallet ready to transact and have access to synced wallet state.

Latest version **1.39.1** (published 2022-09-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install bnc-onboard
pnpm add bnc-onboard
yarn add bnc-onboard
bun add bnc-onboard
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.39.1 |
| Published | 2022-09-22 |
| First published | 2019-10-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 31 |
| Unpacked size | 2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 922 |
| Author | Aaron Barnard |
| Maintainers | tdawson, aaronbarnard1, cmeisl |
| Keywords | ethereum, web3, blocknative, wallet |

## Links

- npm: https://www.npmjs.com/package/bnc-onboard
- Repository: https://github.com/blocknative/onboard
- Homepage: https://github.com/blocknative/onboard#readme
- Issues: https://github.com/blocknative/onboard/issues
- npm.io page: https://npm.io/package/bnc-onboard

## Dependencies (31)

- [hdkey](https://npm.io/package/hdkey.md) ^2.0.1
- [bowser](https://npm.io/package/bowser.md) ^2.10.0
- [bnc-sdk](https://npm.io/package/bnc-sdk.md) ^4.1.0
- [authereum](https://npm.io/package/authereum.md) ^0.1.12
- [fortmatic](https://npm.io/package/fortmatic.md) ^2.2.1
- [walletlink](https://npm.io/package/walletlink.md) ^2.5.0
- [@portis/web3](https://npm.io/package/@portis/web3.md) ^4.0.0
- [bignumber.js](https://npm.io/package/bignumber.js.md) ^9.0.0
- [eth-provider](https://npm.io/package/eth-provider.md) ^0.6.1
- [eth-sig-util](https://npm.io/package/eth-sig-util.md) ^3.0.1
- [ethereumjs-tx](https://npm.io/package/ethereumjs-tx.md) ^2.1.2
- [@ethereumjs/tx](https://npm.io/package/@ethereumjs/tx.md) ^3.0.0
- [trezor-connect](https://npm.io/package/trezor-connect.md) ^8.1.9
- [ethereumjs-util](https://npm.io/package/ethereumjs-util.md) ^7.0.3
- [@cvbb/eth-keyring](https://npm.io/package/@cvbb/eth-keyring.md) ^1.1.0
- [@ensdomains/ensjs](https://npm.io/package/@ensdomains/ensjs.md) ^2.0.1
- [@ethereumjs/common](https://npm.io/package/@ethereumjs/common.md) ^2.0.0
- [eth-lattice-keyring](https://npm.io/package/eth-lattice-keyring.md) ^0.2.7
- [regenerator-runtime](https://npm.io/package/regenerator-runtime.md) ^0.13.7
- [@ledgerhq/hw-app-eth](https://npm.io/package/@ledgerhq/hw-app-eth.md) 6.8.1
- [web3-provider-engine](https://npm.io/package/web3-provider-engine.md) ^15.0.4
- [@toruslabs/torus-embed](https://npm.io/package/@toruslabs/torus-embed.md) ^1.10.11
- [@keystonehq/eth-keyring](https://npm.io/package/@keystonehq/eth-keyring.md) 0.9.0
- [@gnosis.pm/safe-apps-sdk](https://npm.io/package/@gnosis.pm/safe-apps-sdk.md) ^6.2.0
- [@ledgerhq/hw-transport-u2f](https://npm.io/package/@ledgerhq/hw-transport-u2f.md) ^5.21.0
- [@shapeshiftoss/hdwallet-core](https://npm.io/package/@shapeshiftoss/hdwallet-core.md) ^1.15.2
- [@walletconnect/web3-provider](https://npm.io/package/@walletconnect/web3-provider.md) ^1.7.1
- [@gnosis.pm/safe-apps-provider](https://npm.io/package/@gnosis.pm/safe-apps-provider.md) ^0.9.3
- [@ledgerhq/hw-transport-webusb](https://npm.io/package/@ledgerhq/hw-transport-webusb.md) 6.7.0
- [@shapeshiftoss/hdwallet-keepkey](https://npm.io/package/@shapeshiftoss/hdwallet-keepkey.md) ^1.15.2
- [@shapeshiftoss/hdwallet-keepkey-webusb](https://npm.io/package/@shapeshiftoss/hdwallet-keepkey-webusb.md) ^1.15.2

## Recent versions

- 1.39.1 (latest) — 2022-09-22
- 1.39.0 — 2022-08-03
- 1.38.4 — 2022-07-05
- 1.38.3 — 2022-06-01
- 1.38.2 — 2022-03-01
- 1.38.1 — 2022-02-15
- 1.38.0 — 2022-02-13
- 1.37.3 — 2022-02-06
- 1.37.2 — 2022-01-27
- 1.37.1 — 2022-01-19
- 1.37.0 — 2021-12-20
- 1.36.0 — 2021-12-03
- 1.35.4 — 2021-11-04
- 1.35.3 — 2021-10-29
- 1.35.2 — 2021-10-14
- … 109 more at https://npm.io/package/bnc-onboard/versions

## README

# Onboard

JavaScript library to easily onboard users to ethereum apps by enabling wallet selection, connection, wallet checks and real time state updates.

## Install

`npm install bnc-onboard`

## Quick Start

```javascript
import Onboard from 'bnc-onboard'
import Web3 from 'web3'

// set a variable to store instantiated web3
let web3

// head to blocknative.com to create a key
const BLOCKNATIVE_KEY = 'blocknative-api-key'

// the network id that your dapp runs on
const NETWORK_ID = 1

// initialize onboard
const onboard = Onboard({
  dappId: BLOCKNATIVE_KEY,
  networkId: NETWORK_ID,
  subscriptions: {
    wallet: wallet => {
      // instantiate web3 when the user has selected a wallet
      web3 = new Web3(wallet.provider)
      console.log(`${wallet.name} connected!`)
    }
  }
})

// Prompt user to select a wallet
await onboard.walletSelect()

// Run wallet checks to make sure that user is ready to transact
await onboard.walletCheck()
```

## Documentation

For detailed documentation head to [docs.blocknative.com](https://docs.blocknative.com/onboard)

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