Registry / devops / nestjs-eureka-grpc-connector

nestjs-eureka-grpc-connector

JSON →
library0.5.0jsnpmunverified

A NestJS module (v0.5.0, active development) that seamlessly integrates Netflix Eureka service discovery with gRPC clients. Automatically discovers gRPC services from Eureka, provides load-balanced client connections with random balancing, periodic instance refresh, and support for multiple services. Key differentiators: full TypeScript support, async configuration, custom instance processors, and built-in support for both direct Eureka URL and eureka-js-client integration. Released on npm under MIT license.

npm install nestjs-eureka-grpc-connector
INSTALL
IMPORT
SIG · NESTJS-EUREKA-GRPC
N
nestjs-eureka-grpc-connector
devopsjavascriptv0.5.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.

EurekaGRPcConnectorModule
import { EurekaGRPcConnectorModule } from 'nestjs-eureka-grpc-connector'
import EurekaGRPcConnectorModule from 'nestjs-eureka-grpc-connector'
The module is a named export, not default. Common mistake: using default import.
EurekaModuleOptions
import { EurekaModuleOptions } from 'nestjs-eureka-grpc-connector'
Type import for configuration options. Available since v0.5.0.
EurekaGRPcConnectorModule.register
import { EurekaGRPcConnectorModule } from 'nestjs-eureka-grpc-connector'; EurekaGRPcConnectorModule.register({...})
require('nestjs-eureka-grpc-connector').register({...})
ESM-only package. CommonJS require() will fail unless using a bundler. Use dynamic import() for CJS.

Shows how to import and configure the EurekaGRPcConnectorModule with a direct Eureka URL and one gRPC service definition.

import { Module } from '@nestjs/common'; import { join } from 'path'; import { EurekaGRPcConnectorModule } from 'nestjs-eureka-grpc-connector'; @Module({ imports: [ EurekaGRPcConnectorModule.register({ eureka: { url: 'http://eureka-server:8761/eureka/apps', debug: true, }, apps: { 'USER-SERVICE': { package: 'user', protoPath: join(__dirname, './proto/user.proto'), serviceName: 'UserService', }, }, }), ], }) export class AppModule {}
Debug
Known issues
breakingPackage is ESM-only. Do not use require().
fix
Use import syntax or dynamic import() for CommonJS projects.
affects: >=0.5.0
deprecatedThe 'grpc' package is deprecated in favor of '@grpc/grpc-js'. This connector may have compatibility issues.
fix
Switch to @grpc/grpc-js as the gRPC implementation.
affects: >=0.5.0
gotchaThe 'serviceName' in apps config is not the gRPC service name from proto, but an injectable token name. Confusing naming.
fix
Use 'serviceName' as the token to inject the client. It does not need to match the proto service name.
affects: >=0.5.0
breakingThe 'url' option in eureka config expects a full path to /eureka/apps, not just the base URL.
fix
Provide full URL like 'http://eureka-server:8761/eureka/apps'.
affects: >=0.5.0
Errors
Common errors & fixes
Cannot find module 'nestjs-eureka-grpc-connector' or its corresponding type declarations.
Package is ESM-only; TypeScript may need 'esModuleInterop' and 'moduleResolution': 'node16' or 'bundler'.
fix
Set 'esModuleInterop': true and 'moduleResolution': 'node16' in tsconfig.json.
Error: EurekaGRPcConnectorModule is not a constructor
Using CommonJS require() on an ESM-only package.
fix
Use import { EurekaGRPcConnectorModule } from 'nestjs-eureka-grpc-connector' or dynamic import().
EUREKA_SERVICE_NAME: Eureka app not found
Eureka server URL is incorrect or app name does not exist.
fix
Verify the Eureka URL includes /eureka/apps, or use eureka-js-client with correct configuration.
Upgrade
Version history
0.5.0latest on npm
Audit
Dependencies
@nestjs/commonrequiredPeer dependency for NestJS module decorators and dependency injection
@nestjs/corerequiredPeer dependency for NestJS module system
grpcrequiredPeer dependency for gRPC client creation (or @grpc/grpc-js)
eureka-js-clientoptionalOptional dependency for Eureka client integration
Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
nestjs-eureka-grpc-connector — npm install nestjs-eureka-grpc-connector · libregistry