Skip to main content

Prerequisites

  • Node.js 22.13 to 26

Installation

Basic Setup

A mnemonic, a phrase of 12 words, controls the wallet and its funds. Generate it once, in your project folder:
Store the mnemonic securely: anyone who has it can spend the funds. The examples in these docs read it from the ARKADE_MNEMONIC environment variable. In production, load it from your platform’s secure storage, and never log it.
In Node.js, add three steps. The wallet stores its data in IndexedDB by default, and Node.js has no IndexedDB. Node.js also has no EventSource by default.
  • Pass a storage option to Wallet.create. Without it, the wallet can’t save its data, and reads such as getBalance() throw.
  • Call configureEventSource before Wallet.create. Without it, boarding, renewal, and offboarding throw.
  • Call await wallet.dispose() when your script is done. Without it, the script never exits.
For a complete Node.js setup, see Storage Repositories.

Next Steps