Registry / ai-ml / stormee-websocket

stormee-websocket

JSON →
library1.0.5jsnpmunverified

Framework-agnostic WebSocket library for real-time audio streaming with MessagePack and Opus encoding. Version 1.0.5, active development. Supports auto-reconnection, heartbeat, message queuing, resumption from last position after disconnect. Key differentiators: framework-agnostic core with dedicated React hooks and VS Code extension adapters, opinionated audio pipeline with MessagePack decoding and Opus playback, TypeScript-first with full type definitions. Alternative to lower-level libraries like `ws` or `socket.io` for audio streaming use cases. Peer dependency on React >=18.0.0 for the React integration. Release cadence irregular as of initial release.

npm install stormee-websocket
INSTALL
IMPORT
SIG · STORMEE-WEBSOCKET
S
stormee-websocket
ai-mljavascriptv1.0.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

StormeeService
import { StormeeService } from '@stormee-websocket/library/core'
import StormeeService from '@stormee-websocket/library'
Core class is exported from a sub-path 'core', not the main entry point. Default import is not available.
useStormee
import { useStormee } from '@stormee-websocket/library/react'
import { useStormee } from '@stormee-websocket/library'
React hook is exported from 'react' sub-path. Importing from main entry will not provide it.
StormeeVSCodeAdapter
import { StormeeVSCodeAdapter } from '@stormee-websocket/library/vscode'
VS Code adapter is exported from 'vscode' sub-path. Ensure you have VS Code types installed for TypeScript.

Create a StormeeService instance, initialize, connect, and start an audio streaming session with configuration for WebSocket, audio settings, and event handlers.

import { StormeeService } from '@stormee-websocket/library/core'; const service = new StormeeService({ websocket: { url: process.env.WS_URL ?? 'ws://localhost:8000/ws', autoReconnect: true, maxReconnectAttempts: 3, }, audio: { sampleRate: 24000, channels: 1, autoPlay: true, initialVolume: 1.0, }, eventHandlers: { onTranscription: (text) => console.log('Transcription:', text), onAudioChunk: (data) => console.log('Audio received'), onStreamEnd: () => console.log('Stream ended'), onError: (error) => console.error('Error:', error), }, debug: true, }); await service.initialize(); await service.connect('session-uuid'); await service.startStreaming({ sessionId: 'session-uuid', conciergeName: 'Stormee', userQuery: 'Hello, how are you?', chat_history: [], metadata: { userName: 'John' }, queryNumber: '1', });
Debug
Known issues
gotchaAll named exports are from sub-paths: 'core', 'react', 'vscode'. Importing from the main package entry '@stormee-websocket/library' does not export any of these symbols.
fix
Use '@stormee-websocket/library/core' for core service, '@stormee-websocket/library/react' for React hook, '@stormee-websocket/library/vscode' for VS Code adapter.
affects: >=1.0.0
gotchaThe package ships as ESM only. CommonJS require() will not work without a bundler or Node.js ESM support.
fix
Use import syntax or configure your bundler to handle ESM packages. If using Node.js, set 'type': 'module' in package.json or use dynamic import.
affects: >=1.0.0
gotchaReact integration requires React >=18.0.0 as a peer dependency. Older React versions may cause errors.
fix
Ensure your project has React 18 or later installed. Run 'npm install react@^18.0.0'.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module '@stormee-websocket/library' or its corresponding type declarations.
Importing from the main package instead of a sub-path.
fix
Import from a specific sub-path: e.g., import { StormeeService } from '@stormee-websocket/library/core'.
Module not found: Error: Package path ./react is not exported from package @stormee-websocket/library
The sub-path 'react' is not exported or the package is not installed correctly.
fix
Ensure you installed the package correctly (npm install @stormee-websocket/library) and check that your bundler supports the 'exports' field in package.json.
TypeError: StormeeService is not a constructor
Using default import instead of named import, or importing from wrong path.
fix
Use named import: import { StormeeService } from '@stormee-websocket/library/core'.
Uncaught Error: React is not defined
Using the React hook without having React installed.
fix
Install React: npm install react@^18.0.0. Note: React is only required if you use the 'react' sub-path.
Upgrade
Version history
1.0.5latest on npm
Audit
Dependencies
reactoptionalReact hooks integration requires React >=18.0.0
Agent activity
17 hits · last 30 days
node
14
OpenAI (training)
1
Resources
stormee-websocket — npm install stormee-websocket · libregistry