Registry / ai-ml / echofi-client

echofi-client

JSON →
library5.0.0jsnpmunverified

A TypeScript/JavaScript client library for EchoFi services (v5.0.0). Automatically generates gRPC-Web clients from proto files, providing a unified interface to access Music, User, Activity, and Stats services with full TypeScript support and real-time WebSocket communication. Works in browsers and Node.js environments. Key differentiator: auto-generation from proto files ensures zero manual code changes when adding new services. Active development on GitHub.

npm install echofi-client
INSTALL
IMPORT
SIG · ECHOFI-CLIENT
E
echofi-client
ai-mljavascriptv5.0.0
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.

EchoFiGrpcWebClient
import { EchoFiGrpcWebClient } from 'echofi-client'
const { EchoFiGrpcWebClient } = require('echofi-client')
ESM only. CJS require or destructuring will fail. Use import or dynamic import for Node.js.
Messages
import { Messages } from 'echofi-client'
import Messages from 'echofi-client'
Messages is a named export, not default.
EchoFiGrpcWebClientConfig
import type { EchoFiGrpcWebClientConfig } from 'echofi-client'
import { EchoFiGrpcWebClientConfig } from 'echofi-client'
TypeScript type import recommended to avoid runtime overhead.
default export
import EchoFiClient from 'echofi-client'
import { default } from 'echofi-client'
Default export available for quick import, but named imports are preferred.

Demonstrates initializing the gRPC client and making a paginated request to the Music service.

import { EchoFiGrpcWebClient, Messages } from 'echofi-client'; const client = new EchoFiGrpcWebClient({ host: 'localhost', port: 8080 }); await client.initialize(); const request = new Messages.Music.Service.ListArtistsRequest(); request.setOffset(0); request.setLimit(10); const response = await client.music.listArtists(request); const artists = response.getArtistsList(); console.log('Artists:', artists.map(a => ({ id: a.getArtistId(), name: a.getName() })));
Debug
Known issues
breakingIn v5.0.0, client.initialize() must be called before any service methods; previous versions auto-initialized on first call
fix
Add await client.initialize() after construction.
affects: >=5.0.0
gotchaMessages is a large object; tree-shaking may not work due to dynamic message class references
fix
Import only needed message classes via deep imports if available, e.g. import { ListArtistsRequest } from 'echofi-client/dist/messages/music'.
affects: >=5.0.0
deprecatedUse of grpc-web package directly is deprecated; use built-in WebSocket support
fix
Set WebSocket options in client config instead of using grpc-web directly.
affects: >=5.0.0
gotchaIn Node.js, ESM must be enabled (type:module in package.json) or use import()
fix
Use dynamic import: const { EchoFiGrpcWebClient } = await import('echofi-client');
affects: >=5.0.0
Errors
Common errors & fixes
TypeError: echofi_client_1.EchoFiGrpcWebClient is not a constructor
Using CommonJS require with destructuring on an ESM-only package
fix
Change const EchoFiGrpcWebClient = require('echofi-client') to const { EchoFiGrpcWebClient } = await import('echofi-client')
Error: Cannot find module 'protobufjs'
Missing peer dependency protobufjs
fix
Install protobufjs: npm install protobufjs
TypeError: client.music.listArtists is not a function
client.initialize() not called before using services
fix
Add await client.initialize() before any service calls
Module not found: Error: Can't resolve 'grpc-web'
Using in browser without grpc-web installed
fix
Install grpc-web: npm install grpc-web
Upgrade
Version history
5.0.0latest on npm
Audit
Dependencies
protobufjsrequiredRequired for protobuf message encoding/decoding
grpc-weboptionalRequired for gRPC-Web client in browsers
@grpc/grpc-jsoptionalRequired for gRPC client in Node.js
Agent activity
13 hits · last 30 days
node
10
Amazon
1
OpenAI (training)
1
Resources
echofi-client — npm install echofi-client · libregistry