0.1.10 • Published 1 year ago
@mitch528/react-native-grpc v0.1.10
react-native-grpc
gRPC for react-native
Installation
npm install @mitch528/react-native-grpc
Usage
import { GrpcClient, GrpcMetadata } from '@mitch528/react-native-grpc';
GrpcClient.setHost('example.com');
// Bring your own protobuf library
// This example uses https://github.com/timostamm/protobuf-ts
const request = ExampleRequest.create({
message: 'Hello World!',
});
const data: Uint8Array = ExampleRequest.toBinary(request);
const headers: GrpcMetadata = {};
const { response } = await GrpcClient.unaryCall(
'/example.grpc.service.Examples/SendExampleMessage',
data,
headers
);
const responseMessage = 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
1.0.0-9
1 year ago
1.0.0-10
1 year ago
1.0.0-7
1 year ago
1.0.0-8
1 year ago
1.0.0-5
1 year ago
1.0.0-4
1 year ago
1.0.0-6
1 year ago
1.0.0-1
1 year ago
1.0.0-0
1 year ago
1.0.0-3
1 year ago
1.0.0-2
1 year ago
0.1.10
2 years ago
0.1.9
2 years ago
0.1.8
2 years ago
0.1.7
2 years ago
0.1.6
2 years ago
0.1.5
2 years ago
0.1.4
3 years ago
0.1.3
3 years ago
0.1.2
3 years ago
0.1.1
3 years ago