Adonis gRPC Consumer is a provider for AdonisJS (v5) that simplifies communication with gRPC services. It integrates seamlessly with the Adonis framework, providing a declarative configuration for gRPC clients, automatic connection management, and TypeScript support. Version 0.1.2 is the latest stable release. Unlike generic gRPC clients, it leverages Adonis's IoC container and lifecycle, reducing boilerplate for defining and injecting gRPC service stubs. The package ships its own type definitions and uses @grpc/grpc-js and @grpc/proto-loader for gRPC connectivity.
npm install adonis-grpc-consumerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures a gRPC client for an AdonisJS app and uses it to call a remote procedure with type safety.
Ensure the protoPath in config is correct. For example: path.join(__dirname, '../proto/myService.proto').
Double-check the import string: '@ioc:Adonis/Addons/GrpcConsumer' exactly.
Run: npx build-proto --longs=String --enums=String --defaults --oneofs --grpcLib=@grpc/grpc-js --outDir=./proto/ ./proto/*.proto
Run 'node ace configure adonis-grpc-consumer' to register the provider.
Verify the gRPC server is running and the URL in config/grpc-consumer.ts matches the server address.
Regenerate TypeScript definitions using 'npx build-proto' and ensure the import path matches the generated file location.