Install library as npm module:
npm install trezor-connect
or
yarn add trezor-connect
Include library as inline script:
<script src="https://connect.trezor.io/7/trezor-connect.js"></script>
ES6
import TrezorConnect from 'trezor-connect';
CommonJS
var TrezorConnect = require('trezor-connect').default;
Inline
var TrezorConnect = window.TrezorConnect;
Starting with Trezor Connect 7, we have implemented a new feature — Trezor Connect Manifest — which requires that you as a Trezor Connect integrator, to share your e-mail and application url with us. This provides us with the ability to reach you in case of any required maintenance. This subscription is mandatory. Trezor Connect raises an error that reads "Manifest not set. Read more at https://github.com/trezor/connect/blob/develop/docs/index.md" if manifest is not provided.
TrezorConnect.manifest({
email: 'developer@xyz.com',
appUrl: 'http://your.application.com'
})
- clone repository:
git clone git@github.com:trezor/connect.git
- install node_modules:
yarn
- run localhost server:
yarn dev
Initialize in project
TrezorConnect.init({
connectSrc: 'https://localhost:8088/',
lazyLoad: true, // this param will prevent iframe injection until TrezorConnect.method will be called
manifest: {
email: 'developer@xyz.com',
appUrl: 'http://your.application.com',
}
})
In order to run a branch which isn't published to npm registry and this branch requires changes (mostly happened when new a method is added to TrezorConnect interface)
- git checkout
custom-feature-branch
- yarn build:npm
Install builded lib in your project:
- cd ./npm && yarn link
- Inside your project:
yarn install trezor-connect
- Inside your project:
yarn install trezor-connect@file:/[local-path-to-repository]/npm