Configuration
Configuration
hive.configs is the configuration object you passed to the client — stored, frozen and fully typed. The SDK does not manage staging, production or testing.
Inspect configuration liveOne client, one config
const hive = new HiveClient(config);
hive.configs; // exactly `config`, frozenEverything you pass, except the SDK runtime options endpoint, beaconUrl and environment, is stored verbatim under hive.configs. There is no active configuration, no environment switching and no mutation API.
Your own structure
const hive = new HiveClient({
accounts: {
treasury: { accountEnv: "HIVE_TREASURY_ACCOUNT", keyEnv: "HIVE_TREASURY_ACTIVE_KEY" },
},
tests: {
accounts: { minter: "test-minter" },
},
game: {
accounts: { rewards: "game-rewards" },
},
});
hive.configs.tests.accounts.minter; // "test-minter"
hive.configs.game.accounts.rewards; // "game-rewards"Names like tests, game or production are your concepts, not the SDK's. TypeScript infers the exact shape you passed, so nested access stays typed. You can also declare the shape explicitly:
type AppConfig = {
accounts: { treasury: { accountEnv: string } };
tests: { accounts: { minter: string } };
};
const hive = new HiveClient<AppConfig>({ /* ... */ });Note
The accounts key
accounts is the one key the SDK reads: it maps developer-defined aliases to real Hive accounts, directly or through environment variables, and produces the key-free references in hive.accounts.
hive.accounts.treasury; // key-free AccountReference
hive.listAccounts(); // ["treasury"]
hive.resolveAccount("treasury"); // { alias, account } — never key materialMultiple instances
const testHive = new HiveClient(testConfig);
const productionHive = new HiveClient(productionConfig);
testHive.configs;
productionHive.configs;Need different configurations? Create different clients. They share nothing, so there is never an ambiguous "current" context.
