TypeScript gRPC client plugin for Egg.js framework, wrapping @grpc/grpc-js. Version 3.0.2 is the latest stable release with maintenance updates. Provides Egg-style declarative configuration for multiple gRPC clients, health checks, and distributed tracing via grpcMeta. Compared to egg-grpc-client, this plugin has TypeScript definitions and improved error metadata.
npm install egg-grpc-client-tsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures the egg-grpc-client-ts plugin and uses it in an Egg.js service to call a gRPC service.
Upgrade to Node.js 10+ or stay on v1.x.
Ensure @grpc/grpc-js is installed (it's a dependency). Update any direct requires of 'grpc' to '@grpc/grpc-js'.
Use ES module syntax: `export default { grpcClient: { enable: true, package: 'egg-grpc-client-ts' } };`Wrap client calls with retry logic or use a higher-level library that supports reconnection.
Run `npm install @grpc/grpc-js` and update imports to use '@grpc/grpc-js'.
Check plugin.ts: exports.grpcClient = { enable: true, package: 'egg-grpc-client-ts' }; Also ensure plugin directory is in egg's plugin path.Set exports.grpcClient = { clients: [{ name, protoPath, host, port }] };