Start with the Hedera JavaScript SDK

Understand Hedera SDK clients, identifiers, transactions and receipts. Start with the current JavaScript package and learn safely on testnet.

Content reviewed on

The Hedera JavaScript SDK gives an application tools for building queries and transactions. Use it when you need network operations such as creating a token or transferring an NFT. For ordinary public NFT lookups, a mirror-node REST request can be the simpler starting point.

Hedera's current JavaScript quickstart uses @hiero-ledger/sdk. Follow that maintained setup in a separate learning project with a supported Node release. Do not replace an existing application's SDK dependency without checking its migration requirements.

The objects you will meet

A client selects the network and connection settings. An account ID identifies an account. A token ID identifies a token collection. An NFT ID combines a token ID with a serial.

A transaction describes a requested change. A signature authorizes it under the relevant key rules. A receipt reports the outcome and can include newly created identifiers.

These objects have different roles. Successfully constructing a transaction does not mean it was submitted, and a submitted request does not prove it succeeded.

Parse an NFT identifier first

After setting up the current SDK in your learning project, this small example parses an illustrative token and serial:

import { TokenId, NftId } from '@hiero-ledger/sdk';

const token = TokenId.fromString('0.0.1234567');
const nft = new NftId(token, 1);
console.log(nft.toString());

The example does not contact the network or confirm that this illustrative NFT exists. It shows why a serial belongs with a collection ID.

Keep network and credentials explicit

Use testnet for the next exercises and disposable test credentials. Keep those credentials outside source control and never substitute a production recovery phrase into a tutorial.

A mainnet account and a testnet account are not interchangeable. Display the network beside the IDs in your logs and examples.

Read the receipt, then the application state

For a transaction exercise, retain the SDK transaction ID before network submission and inspect the resulting receipt. If a wallet flow has not exposed an ID, preserve the operation reference and wallet history while investigating. Use returned token IDs and serials rather than guessing what the network created.

When you later read mirror data, allow for indexing delay. If the result is unclear, stop and resolve the original operation before creating another transaction.

Create and transfer one testnet NFT, or learn the transaction lifecycle.