MCPcopy Index your code
hub / github.com/Mitch528/react-native-grpc

github.com/Mitch528/react-native-grpc @v1.0.0-10

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.0-10 ↗ · + Follow
100 symbols 183 edges 26 files 3 documented · 3%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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

Extension points exported contracts — how you extend this code

GrpcServerInputStream (Interface)
(no doc) [2 implementers]
src/types.ts
GrpcServerOutputStream (Interface)
(no doc) [2 implementers]
src/types.ts

Core symbols most depended-on inside this repo

createDeferred
called by 5
src/client.ts
emitEvent
called by 4
android/src/main/java/com/reactnativegrpc/GrpcModule.java
then
called by 4
src/unary.ts
startGrpcCall
called by 3
android/src/main/java/com/reactnativegrpc/GrpcModule.java
getId
called by 3
src/client.ts
cancel
called by 3
src/unary.ts
on
called by 3
src/types.ts
makePath
called by 2
example/src/transport.ts

Shape

Method 72
Class 22
Function 4
Interface 2

Languages

Java50%
TypeScript50%

Modules by API surface

android/src/main/java/com/reactnativegrpc/GrpcModule.java19 symbols
src/server-streaming.ts12 symbols
src/client.ts9 symbols
example/src/transport.ts9 symbols
example/android/app/src/main/java/com/example/reactnativegrpc/MainApplication.java7 symbols
example/android/app/src/main/java/com/example/reactnativegrpc/MainActivity.java7 symbols
src/unary.ts6 symbols
android/src/main/java/com/reactnativegrpc/GrpcConnection.java6 symbols
src/types.ts5 symbols
src/client-streaming.ts5 symbols
example/android/app/src/debug/java/com/example/reactnativegrpc/ReactNativeFlipper.java5 symbols
src/errors.ts3 symbols

For agents

$ claude mcp add react-native-grpc \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact