Install SDK

Overview

The BitGo JavaScript SDK and Node Package Manager (NPM) libraries enable you to build apps and services for all the Coins and Tokens that BitGo supports. The SDK is an out-of-the-box solution that runs in a browser or Node.js and solves complicated transactional logic required to integrate BitGo REST APIs.

You can use the SDK to:

  • Create and manage wallets and addresses.
  • Create and execute secure, co-signed transactions.
  • Create, store, and interact with tokens and NFTs.
  • Implement personal on-premise servers in conjunction with the BitGo Express package for secure interactions with the BitGo Platform.
  • Sign keys offsite and send transactional data confidently to BitGo APIs.

You have 2 options for installing the SDK:

  • Modular - Integrate only the coins you need.
  • All Coins - Integrate all coins that BitGo supports.

Note: BitGo recommends you implement a modular integration for the following benefits:

  • Better compatibility in resource-constrained environments (such as running in AWS lambda)
  • Reduce dependency exposure
  • Smaller install and memory footprint

Prerequisites

Set up your coding environment. We recommend the following:

Core Packages

  • Modular
  • All Coins

The following core packages enable you to integrate only the coins you need:

  • sdk-api - Main entry point for API functionality and for registering coins asynchronously.
  • sdk-coin-{name} - Implementation and dependencies necessary to interact with BitGo APIs and coin blockchains (such as mainnet, testnet, and any related tokens).

Steps

1. Install Core Packages

  • CLI (modular)
  • CLI (all coins)
1 2 3 4 5 # Main entry point for API functionality npm install @bitgo/sdk-api # Individual coin module # For example, btc would be sdk-coin-btc npm install @bitgo/sdk-coin-{name}

2. Use Core Packages

  • CLI (modular)
  • CLI (all coins)
1 2 3 4 5 6 import { BitGoAPI } from '@bitgo/sdk-api'; import { Btc } from '@bitgo/sdk-coin-btc'; const sdk = new BitGoAPI(); sdk.register('btc', Btc.createInstance);

Note: You must import testnet coins separately. For example, you would import Tbtc instead of Btc.

Next

Create Wallets

See Also