Registry / messaging / grpc-react-native

grpc-react-native

JSON →
library0.3.2jsnpmunverified

A truly native gRPC implementation for React Native, leveraging platform-specific gRPC libraries (C-core on iOS/Android). Currently at v0.3.2, it's in early development and not yet stable. Supports bidirectional streaming and TLS. Key differentiator: uses native gRPC instead of JavaScript polyfills, offering better performance and protocol fidelity for mobile gRPC use cases. Ships TypeScript definitions.

npm install grpc-react-native
INSTALL
IMPORT
SIG · GRPC-REACT-NATIVE
G
grpc-react-native
messagingjavascriptv0.3.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

createClient
import { createClient } from 'grpc-react-native'
const createClient = require('grpc-react-native').createClient
Package is ESM-only; CommonJS require may not work properly.
GrpcClient
import { GrpcClient } from 'grpc-react-native'
import GrpcClient from 'grpc-react-native'
GrpcClient is a named export, not default.
Credentials
import { Credentials } from 'grpc-react-native'
Credentials object for TLS configuration.

Shows how to create a gRPC client, define a service, and make a unary call with TLS.

import { createClient, GrpcClient, Credentials } from 'grpc-react-native'; const client = new GrpcClient({ host: 'api.example.com', port: 443, useTls: true, credentials: Credentials.createSsl(), }); const exampleService = client.createService('grpc.examples.ExampleService', { unaryCall: { path: '/grpc.examples.ExampleService/UnaryCall', requestStream: false, responseStream: false }, }); const call = exampleService.unaryCall({ name: 'world' }); call.on('data', (response) => console.log(response.message)); call.on('error', (error) => console.error(error));
Debug
Known issues
gotchaPackage is in early development; APIs may change without notice. Not recommended for production.
fix
Lock dependency to a specific version and test thoroughly.
affects: >=0.0.0 <1.0.0
gotchaRequires native build setup (CocoaPods for iOS, Gradle for Android). Not compatible with Expo or React Native CLI without native modules.
fix
Ensure ReactNative host app supports native modules and run pod install.
affects: >=0.0.0
gotchaDoes not support server reflection or advanced gRPC features (e.g., interceptor, call credentials) in current version.
fix
Use grpc-web or a different library if these features are needed.
affects: >=0.0.0 <0.4.0
Errors
Common errors & fixes
Module 'grpc-react-native' not found in Haste module map
react-native cannot resolve the package due to missing podspec or native module linking.
fix
Run 'cd ios && pod install' or ensure native module is linked properly.
TypeError: Cannot read property 'createClient' of undefined
Using CommonJS require() with ESM-only package.
fix
Use import syntax: import { createClient } from 'grpc-react-native'.
Upgrade
Version history
0.3.2latest on npm
Audit
Dependencies
reactrequiredPeer dependency; React Native app requires React
react-nativerequiredPeer dependency; React Native runtime required
Agent activity
20 hits · last 30 days
node
16
OpenAI (training)
1
Resources
grpc-react-native — npm install grpc-react-native · libregistry