Registry / productivity / grpc-docs

grpc-docs

JSON →
library1.1.4jsnpmunverified

gRPC Docs is an interactive API documentation component for gRPC APIs, similar to Swagger UI but tailored for gRPC. Version 1.1.4 is the current stable release. It provides a React component that renders documentation from protoc-generated JSON descriptors. Updated occasionally. Key differentiators: supports both self-hosted protoc JSON and GenDocu Cloud service; includes environment and authentication scheme configuration via YAML. Requires React 16+ and Node 10+. It can be used as a standalone widget or integrated with GenDocu CI/CD. The package is primarily used in React applications to document gRPC services.

npm install grpc-docs
INSTALL
IMPORT
SIG · GRPC-DOCS
G
grpc-docs
productivityjavascriptv1.1.4
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.

GRPCSelfGeneratedAPIReference
import { GRPCSelfGeneratedAPIReference } from 'grpc-docs'
const GRPCSelfGeneratedAPIReference = require('grpc-docs')
Named export for standalone use with protoc JSON. Requires ESM or bundler setup; CommonJS require may work with bundlers.
GRPCGenDocuAPIReference
import { GRPCGenDocuAPIReference } from 'grpc-docs'
import GRPCGenDocuAPIReference from 'grpc-docs'
Named export for GenDocu Cloud integration. Default import will fail.
React component usage
<GRPCSelfGeneratedAPIReference file='path/to/descriptors.json' />
<GRPCSelfGeneratedAPIReference definition='path/to/descriptors.json' />
The 'file' prop expects a URL (string) to the JSON file, while 'definition' expects the raw JSON string. Common mistake: using 'file' for raw JSON.

Shows basic integration of gRPC Docs in a React component with a remote protoc JSON descriptor file.

import React from 'react'; import { GRPCSelfGeneratedAPIReference } from 'grpc-docs'; const App = () => { return ( <div> <h1>My gRPC API Docs</h1> <GRPCSelfGeneratedAPIReference file='https://example.com/descriptors.json' /> </div> ); }; export default App;
Debug
Known issues
gotchaThe 'file' and 'definition' props are mutually exclusive; providing both might cause unexpected behavior.
fix
Use either 'file' for a URL string or 'definition' for a JSON string, not both.
affects: >=1.0.0
breakingReact 16 is required as a peer dependency. Lower versions are not supported.
fix
Ensure your project uses React 16 or higher.
affects: >=1.0.0
deprecatedNode 10 is the minimum for version 1.1.4. Future versions may require Node 12+.
fix
Upgrade to Node 12+ for future compatibility.
affects: >=1.0.0
gotchaThe package is not designed for server-side rendering (SSR) out of the box.
fix
If using SSR, ensure the component is only rendered on the client side or use dynamic imports.
affects: >=1.0.0
breakingThe component expects JSON generated by protoc-gen-doc in the protoc-doc JSON format; other formats will fail.
fix
Use protoc-gen-doc with --doc_opt=json,description.json to generate the correct format.
affects: >=1.0.0
Errors
Common errors & fixes
Error: 'import' is not defined (or similar ESM issues)
Using CommonJS require() incorrectly with named exports.
fix
Use import syntax: import { GRPCSelfGeneratedAPIReference } from 'grpc-docs'
TypeError: GRPCSelfGeneratedAPIReference is not a constructor
Using CommonJS require() which returns an object, not the component directly.
fix
Use import syntax or destructure: const { GRPCSelfGeneratedAPIReference } = require('grpc-docs');
Error: Cannot find module 'grpc-docs'
Module not installed or bundler not configured for node_modules resolution.
fix
Run npm install --save grpc-docs and ensure your bundler resolves node_modules.
Upgrade
Version history
1.1.4latest on npm
Audit
Dependencies
reactrequiredPeer dependency: required to use the React components
Agent activity
30 hits · last 30 days
node
28
OpenAI (training)
1
Resources
grpc-docs — npm install grpc-docs · libregistry