Skip to main content

Getting Started With Node.js

Password Storage

Never store passwords or seeds on a host's environment variables or in the source code in a production setup. Please follow our backup and security recommendations for production use.

Requirements

  • One of the following Node.js versions:

    • '14.x'
    • '16.x' (LTS) .
    • '18.x' (Current).
  • Rust and Cargo to compile the binding.

Install the Library

You can install the library using npm or yarn with the following commands:

npm

npm i @iota/client

Yarn

yarn add @iota/client

Use the Library

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

import { Client } from '@iota/client';

const client = new Client({
nodes: ['https://api.testnet.shimmer.network'],
});

client.getInfo().then(console.log).catch(console.error);

Connecting to MQTT

Connecting to a MQTT broker using a raw ip doesn't work with TCP. This is a limitation of rustls.

What's Next?

Now that you are up and running, you can get acquainted with the library using its how-to guides and the repository's code examples.