9.2.2 • Published 8 days ago

@trezor/connect-web v9.2.2

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
github
Last release
8 days ago

@trezor/connect-web

Build Status NPM Known Vulnerabilities

This package is bundled into web implementations.

Contains minimum of code required to:

  • Define TrezorConnect API object
  • Create and handle communication between @trezor/connect-iframe hosted on https://connect.trezor.io/<version>/iframe.html
  • Create and handle communication and lifecycle of @trezor/connect-popup hosted on https://connect.trezor.io/<version>/popup.html

Usage

yarn add @trezor/connect-web
import TrezorConnect from '@trezor/connect-web';

// set manifest once anywhere in your app index
TrezorConnect.manifest({
    appUrl: 'https://my.app.com',
    email: 'developer@email.com',
});

function getAddress() {
    const btcAddress = await TrezorConnect.getAddress({ path: "m/84'/0'/'0'/0/0", coin: 'btc' });
    if (btcAddress.success) {
        return btcAddress.payload; // { address: "xxx" }
    }
}

For more examples see TrezorConnect API documentation

NPM publish:

Follow instructions how to publish @trezor package to npm registry.

Dev

It is possible to run local dev server with iframe and popup using:

yarn workspace @trezor/connect-web dev

Note: don't forget to visit https://localhost:8088/ and allow self-signed certificate. No UI is displayed here.

With dev server running, you may initialize TrezorConnect like this

import TrezorConnect from '@trezor/connect-web';

const connectOptions = {
    connectSrc: 'https://localhost:8088/',
    manifest: {
        email: 'info@trezor.io',
        appUrl: '@trezor/suite',
    },
};
9.2.3

8 days ago

9.2.2

1 month ago

9.2.1

2 months ago

9.2.0

2 months ago

9.1.12

3 months ago

9.1.11

3 months ago

9.1.10

4 months ago

9.1.9

4 months ago

9.1.8

4 months ago

9.1.7

5 months ago

9.1.6

5 months ago

9.1.5

6 months ago

9.1.4

7 months ago

9.1.3

8 months ago

9.1.2

8 months ago

9.1.1

9 months ago

9.0.9

12 months ago

9.0.11

12 months ago

9.0.10

12 months ago

9.0.8

1 year ago

9.0.7

1 year ago

9.0.6

1 year ago

9.0.5

1 year ago

9.0.4

1 year ago

9.0.3

2 years ago

9.0.2

2 years ago

9.0.1

2 years ago

9.0.0

2 years ago

9.0.0-beta.7

2 years ago

9.0.0-beta.6

2 years ago

9.0.0-beta.5

2 years ago

9.0.0-beta.4

2 years ago

9.0.0-beta.3

2 years ago

9.0.0-beta.2

2 years ago

9.0.0-beta.1

2 years ago