Skip to content

Repository files navigation

react-native-grpc

gRPC for react-native

Installation

npm install @krishnafkh/react-native-grpc

Usage

import{GrpcClient,GrpcMetadata}from'@krishnafkh/react-native-grpc';GrpcClient.setHost('example.com');// Bring your own protobuf library// This example uses https://github.com/timostamm/protobuf-tsconstrequest=ExampleRequest.create({message: 'Hello World!',});constdata: Uint8Array=ExampleRequest.toBinary(request);constheaders: GrpcMetadata={};const{ response }=awaitGrpcClient.unaryCall('/example.grpc.service.Examples/SendExampleMessage',data,headers);constresponseMessage=ExampleMessage.fromBinary(response);

See examples project for more advanced usage.

Limitations

This library currently only supports unary and server-side streaming type RPC calls. PRs are welcome.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

About

gRPC for react-native

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages