Prerequisites
- Node.js 18 or later
- A Hedera testnet account with ECDSA keys from the developer portal
Step 1: Initialize the project and install the SDK
"type": "module" to your package.json:
Step 2: Credentials
Create a.env file (and add it to .gitignore):
OPERATOR_ID is your Hedera account ID (for example, 0.0.1234). OPERATOR_KEY is your account’s ECDSA private key: copy the DER Encoded Private Key (starts with 303...) from the developer portal.
Step 3: Connect, query, transfer
Createindex.js:
Step 4: Run it
What’s next
Create an Account
Generate a new account programmatically and fund it from your operator.
Create a Token
Mint a native HTS token with custom supply and decimals.
Submit to a Topic
Publish a message to HCS for verifiable, ordered audit logs.
SDK Reference
Full API reference on GitHub.