Registry / devops / rn-grpc-bridge

rn-grpc-bridge

JSON →
library0.0.12jsnpmunverified

rn-grpc-bridge is a code generator (v0.0.12) that creates Swift/Android bridge code and TypeScript interfaces from protobuf definitions for React Native apps using gRPC. It automates the mapping between JavaScript dictionaries and native gRPC types, saving manual boilerplate. Currently supports iOS/Swift unary calls and bridge headers; streaming and Android support are incomplete. Distributed as an npm package, it relies on protobuf compilation but has no runtime dependencies.

npm install rn-grpc-bridge
INSTALL
IMPORT
SIG · RN-GRPC-BRIDGE
R
rn-grpc-bridge
devopsjavascriptv0.0.12
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.

generate
import { generate } from 'rn-grpc-bridge'
const generate = require('rn-grpc-bridge')
Package exports a single generate function; ESM import is preferred but CJS require also works.
GrpcClient
import { GrpcClient } from 'rn-grpc-bridge'
GrpcClient is deprecated since v0.0.10; use generate instead.
config
import { config } from 'rn-grpc-bridge'
Optional config type for generate options.

Generate Swift bridge code from a protobuf file, outputting Swift and TypeScript files to a specified directory.

import { generate } from 'rn-grpc-bridge'; import path from 'path'; const protoDir = path.resolve(__dirname, '../protos'); const outDir = path.resolve(__dirname, '../generated'); generate({ protoDir, outDir, language: 'swift', service: 'BookService', protoFile: 'book.proto' }).then(() => { console.log('Bridge code generated successfully'); }).catch(err => { console.error('Generation failed:', err); });
Debug
Known issues
breakingDeprecated generate signature: 'GrpcClient' export was removed in v0.0.10.
fix
Use the 'generate' function instead of 'GrpcClient'.
affects: >=0.0.10
gotchaOnly iOS/Swift unary calls are implemented; streaming and Android are not yet supported.
fix
Check the README for up-to-date supported features. Streaming calls will be added in future releases.
affects: <=0.0.12
gotchaPackage depends on protobuf compiler being installed locally; it does not bundle protoc.
fix
Ensure protoc is available in PATH, or specify the path via options.
affects: all
gotchaGenerated TypeScript interfaces are for reference only; they are not connected to gRPC client libraries.
fix
You must implement the actual gRPC calls using a library like @grpc/grpc-js in React Native (if supported) or use the native bridge.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'rn-grpc-bridge'
Package not installed correctly or missing from node_modules.
fix
Run 'npm install rn-grpc-bridge' in your project root.
TypeError: generate is not a function
Attempted to import 'generate' from an older version that exports 'GrpcClient'.
fix
Update to version >=0.0.10 and use 'import { generate }' or check your import statement.
Error: protoc not found. Please install protobuf compiler.
The protobuf compiler is not installed or not in PATH.
fix
Install protoc via your package manager (e.g., 'brew install protobuf' on macOS) or specify path in options.
Error: No such service 'BookService' in proto file
The specified service name does not exist in the given proto file.
fix
Verify the service name in your proto file (case-sensitive). Use the exact name from the proto definition.
Upgrade
Version history
0.0.12latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
18 hits · last 30 days
node
16
Amazon
1
OpenAI (training)
1
Resources
rn-grpc-bridge — npm install rn-grpc-bridge · libregistry