# @web3-onboard/trezor

> Trezor hardware wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic mo

Latest version **2.4.7** (published 2025-03-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @web3-onboard/trezor
pnpm add @web3-onboard/trezor
yarn add @web3-onboard/trezor
bun add @web3-onboard/trezor
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 2.4.7 |
| Published | 2025-03-06 |
| First published | 2022-02-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 9 |
| Unpacked size | 24.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 923 |
| Maintainers | jakeloo, joaquim-verges |
| Keywords | Ethereum, Web3, EVM, dapp, Multichain, Wallet, Transaction, Provider, Hardware Wallet, Notifications, React, Svelte, Vue, Next, Nuxt, MetaMask, Coinbase, WalletConnect, Ledger, Trezor, Connect Wallet, Ethereum Hooks, Blocknative, Mempool, pending, confirmed, Injected Wallet, Crypto, Crypto Wallet |

## Links

- npm: https://www.npmjs.com/package/@web3-onboard/trezor
- Repository: https://github.com/blocknative/web3-onboard
- Homepage: https://onboard.blocknative.com
- Issues: https://github.com/blocknative/web3-onboard/issues
- npm.io page: https://npm.io/package/@web3-onboard/trezor

## Dependencies (9)

- [hdkey](https://npm.io/package/hdkey.md) ^2.0.1
- [buffer](https://npm.io/package/buffer.md) ^6.0.3
- [eth-crypto](https://npm.io/package/eth-crypto.md) ^2.1.0
- [@ethereumjs/tx](https://npm.io/package/@ethereumjs/tx.md) ^3.4.0
- [ethereumjs-util](https://npm.io/package/ethereumjs-util.md) ^7.1.3
- [@trezor/connect-web](https://npm.io/package/@trezor/connect-web.md) ^9.5.0
- [@web3-onboard/common](https://npm.io/package/@web3-onboard/common.md) ^2.4.1
- [@web3-onboard/hw-common](https://npm.io/package/@web3-onboard/hw-common.md) ^2.3.2
- [@ethersproject/providers](https://npm.io/package/@ethersproject/providers.md) ^5.5.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.4.7 (latest) — 2025-03-06
- 2.4.5-alpha.1 (next) — 2024-05-30
- 2.4.6 — 2024-06-05
- 2.4.5 — 2024-05-31
- 2.4.4 — 2024-03-22
- 2.4.4-alpha.1 — 2024-03-20
- 2.4.3 — 2023-08-29
- 2.4.3-alpha.1 — 2023-08-21
- 2.4.2 — 2023-05-19
- 2.4.2-alpha.3 — 2023-05-19
- 2.4.2-alpha.2 — 2023-05-16
- 2.4.1 — 2023-05-11
- 2.4.1-alpha.2 — 2023-05-09
- 2.4.1-alpha.1 — 2023-05-08
- 2.4.0 — 2023-04-21
- … 48 more at https://npm.io/package/@web3-onboard/trezor/versions

## README

# @web3-onboard/trezor

## Wallet module for connecting Trezor hardware wallets to web3-onboard

### Install

`npm i @web3-onboard/trezor`

### Options

```typescript
type TrezorOptions = {
  email: string
  appUrl: string
  customNetwork?: CustomNetwork
  filter?: Platform[]
  containerElement?: string
  /**
   * A number that defines the amount of consecutive empty addresses displayed
   * within the Account Select modal. Default is 5
   */
  consecutiveEmptyAccountThreshold?: number
}

interface CustomNetwork {
  networkId: number
  genesis: GenesisBlock
  hardforks: Hardfork[]
  bootstrapNodes: BootstrapNode[]
}

interface GenesisBlock {
  hash: string
  timestamp: string | null
  gasLimit: number
  difficulty: number
  nonce: string
  extraData: string
  stateRoot: string
}

interface Hardfork {
  name: string
  block: number | null
}

interface BootstrapNode {
  ip: string
  port: number | string
  network?: string
  chainId?: number
  id: string
  location: string
  comment: string
}

type Platform = DeviceOSName | DeviceBrowserName | DeviceType | 'all'
```

### Usage

```typescript
import Onboard from '@web3-onboard/core'
import trezorModule from '@web3-onboard/trezor'

const trezor = trezorModule({
  email: '<EMAIL_CONTACT>',
  appUrl: '<APP_URL>'
})

const onboard = Onboard({
  // ... other Onboard options
  wallets: [
    trezor
    //... other wallets
  ]
})

const connectedWallets = await onboard.connectWallet()
console.log(connectedWallets)
```

### Filtering Platforms

You may decide that on certain platforms you do not want to display this wallet as a selectable option. To do that you can use the `filter` init option which is an array of platforms that you would like this wallet to **not** be displayed to the end user:

```typescript
import Onboard from '@web3-onboard/core'
import trezorModule from '@web3-onboard/trezor'

const trezor = trezorModule({
  email: '<EMAIL_CONTACT>',
  appUrl: '<APP_URL>',
  filter: ['Safari'] // do not display on Safari
})

const onboard = Onboard({
  // ... other Onboard options
  wallets: [
    trezor
    //... other wallets
  ]
})

const connectedWallets = await onboard.connectWallet()
console.log(connectedWallets)
```

The following is a list of the platforms that can be filtered:

```typescript
type Platform =
  | 'Windows Phone'
  | 'Windows'
  | 'macOS'
  | 'iOS'
  | 'Android'
  | 'Linux'
  | 'Chrome OS'
  | 'Android Browser'
  | 'Chrome'
  | 'Chromium'
  | 'Firefox'
  | 'Microsoft Edge'
  | 'Opera'
  | 'Safari'
  | 'desktop'
  | 'mobile'
  | 'tablet'
```

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