Hoshimi
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

node-select.ts
import type {  } from 'hoshimi';

declare const : ;

const  = ..();

if (!) {
  throw new ('No available nodes');
}

.(.);
.(.);
.(.);

Decode Tracks

node-decode.ts
import type {  } from 'hoshimi';

declare const : ;

const  = await ..('QAAAyAIA...', 'user-id');
const  = await ..(['QAAAyAIA...', 'QAAByAIA...'], 'user-id');

.(..);
.(.);

REST Utility

rest-ops.ts
import type {  } from 'hoshimi';

declare const : ;

const  = await ..();
.(.);

Operational Notes

  • Prefer getLeastUsed() for default load balancing.
  • Validate node.ready before forcing node-specific operations.
  • Use node.rest for low-level operations, and manager/player abstractions for normal flows.

On this page