Steem.js
The JavaScript API for the Steem blockchain. Works in Node.js and the browser, over HTTP (JSON-RPC) or WebSocket.
npm install @steemit/steem-js --save
const steem = require('@steemit/steem-js');
steem.api.getAccounts(['ned', 'dan'], (err, accounts) => {
console.log(err, accounts);
});
// Promises work too:
const [account] = await steem.api.getAccountsAsync(['ned']);
The library at a glance
require('@steemit/steem-js') returns a single object with these namespaces:
| Namespace | What it does | Docs |
|---|---|---|
steem.api |
Read calls to an RPC node (accounts, posts, blocks, market, witnesses…) | API reference |
steem.broadcast |
Sign and broadcast write operations (vote, transfer, comment…) | Broadcast reference · Broadcasting guide |
steem.auth |
Key derivation, WIF handling, transaction signing | Auth guide |
steem.memo |
Encrypt and decrypt transfer memos | Memo guide |
steem.formatter |
Reputation, VESTS↔STEEM, amounts, account value | Formatter guide |
steem.utils |
Account-name validation, string helpers | Utils guide |
steem.config |
Endpoint, chain id, address prefix, testnet | Configuration guide |
The api and broadcast references are generated directly from the library’s source
(methods.js and
operations.js),
so they always list every method the installed version supports.
Where to go next
- New here? Start with Install and Configuration.
- Reading data → API reference.
- Writing to the chain → Broadcasting guide and the Broadcast reference.
- Following the chain in real time → Streaming.