Skip to main content

Install IOTA TypeScript SDK

The IOTA TypeScript SDK is available in the IOTA monorepo and NPM.

Install from NPM

To use the IOTA TypeScript SDK in your project, run the following command in your project root:

npm i @iota/iota-sdk

Experimental tag for use with a local IOTA network

Projects developing against one of the on-chain IOTA networks (Devnet, Testnet, Mainnet) should use the base SDK published in the NPM registry (previous section) because the code aligns with the relevant JSON-RPC. If your developing against a local network built from the main branch of the IOTA monorepo, however, you should use the experimental-tagged SDK package as it contains the latest features (or a local build detailed in the section that follows).

npm i @iota/iota-sdk@experimental

Install from local build

To build the SDK from the IOTA monorepo, you must use pnpm. With pnpm installed, run the following command from the iota root directory:

# Install all dependencies
pnpm install
# Run the build for the TypeScript SDK
pnpm sdk build

With the SDK built, you can import the library from your iota project. To do so, use a path to the iota/sdk/typescript directory that is relative to your project. For example, if you created a folder my-iota-project at the same level as iota, use the following to import the locally built IOTA TypeScript package:

pnpm add ../iota/sdk/typescript