Guides
Node Operations
Work with Node, NodeManager and REST helpers for resilient playback.
Use this page to understand node selection, node health and decode/REST operations. Apply these patterns to reduce routing errors and improve failover behavior.
Type reference: Core API (TypeDoc)
Quick links:
Select Nodes Safely
import type { } from 'hoshimi';
declare const : ;
const = ..();
if (!) {
throw new ('No available nodes');
}
.(.);
.(.);
.(.);Decode Tracks
import type { } from 'hoshimi';
declare const : ;
const = await ..('QAAAyAIA...', 'user-id');
const = await ..(['QAAAyAIA...', 'QAAByAIA...'], 'user-id');
.(..);
.(.);REST Utility
import type { } from 'hoshimi';
declare const : ;
const = await ..();
.(.);Operational Notes
- Prefer
getLeastUsed()for default load balancing. - Validate
node.readybefore forcing node-specific operations. - Use
node.restfor low-level operations, and manager/player abstractions for normal flows.