0.1.10 • Published 2 years 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
2 years ago
1.0.0-10
2 years ago
1.0.0-7
2 years ago
1.0.0-8
2 years ago
1.0.0-5
3 years ago
1.0.0-4
3 years ago
1.0.0-6
2 years ago
1.0.0-1
3 years ago
1.0.0-0
3 years ago
1.0.0-3
3 years ago
1.0.0-2
3 years ago
0.1.10
3 years ago
0.1.9
3 years ago
0.1.8
3 years ago
0.1.7
3 years ago
0.1.6
3 years ago
0.1.5
3 years ago
0.1.4
4 years ago
0.1.3
4 years ago
0.1.2
4 years ago
0.1.1
4 years ago