Skip to main content

Getting Started with Wasm

Safe Password Storage

In a production setup, do not store passwords in the host's environment variables or in the source code. See our backup and security recommendations for production setups.

Before You Start

The IOTA SDK library also offers dedicated Node.js bindings. The differences with this package are outlined below:

Wasm bindingsNode.js bindings
EnvironmentNode.js, browsersNode.js
Installation-Rust, Cargo required*
Ledger Nano✔️
  • The Node.js bindings only need to be compiled during npm install if a pre-compiled binary is not available for your platform.

Use the Node.js bindings if you can. The Wasm bindings are just more portable and support browser environments.

Install Using a Package Manager

To start using the IOTA SDK in your Wasm project, you can install the IOTA SDK from your package manager of choice:

npm i @iota/sdk-wasm

Web Setup

Unlike Node.js, a few more steps are required to use this binding in a browser.

The library loads the compiled Wasm file with an HTTP GET request, so the iota_sdk_wasm_bg.wasm file must be copied to the root of the distribution folder.

A bundler such as webpack or rollup is recommended.

  1. Install rollup-plugin-copy:

    npm install rollup-plugin-copy --save-dev
  2. Add the plugin to your rollup.config.js:

    // Include the copy plugin.
    import copy from 'rollup-plugin-copy';

    // ...

    // Add the copy plugin to the `plugins` array:
    targets: [
    src: 'node_modules/@iota/sdk-wasm/web/wasm/iota_sdk_wasm_bg.wasm',
    dest: 'public',
    rename: 'iota_sdk_wasm_bg.wasm',



After you installed the library, you can create a Client instance and interface with it.



After you installed the library, you can create a Wallet instance and interact with it.


Web Usage

import init, {Wallet, CoinType} from "@iota/sdk-wasm/web";

init().then(() => {
const wallet = new Wallet({
storagePath: './my-database',
coinType: CoinType.Shimmer,
clientOptions: {
nodes: [''],
secretManager: {
mnemonic: "my development mnemonic",

const account = await wallet.createAccount({
alias: 'Alice',

account.addresses().then((addresses) => {

// Default path to load is "iota_sdk_wasm_bg.wasm",
// but you can override it by passing a path explicitly.
// init("./static/iota_sdk_wasm_bg.wasm").then(...)

What's next?

How-To Guides

Once you have installed the IOTA SDK, you can start building your application. You can find usage examples in this Wiki's how-to guides.

More Examples

You can use the provided Node.js code examples to get acquainted with the IOTA SDK. You can use the following commands to run any example:

cd examples
yarn run-example ./[example folder]/[example file]
  • Where [example file] is the file name from the example folder. For example:
yarn run-example examples/client/00_get_info.ts

API Reference

The IOTA SDK Rust API Reference is in the crate documentation.