Utility function for deserializing `grpc-status-details-bin` metadata on grpc-web to access richer gRPC error details (protobuf messages) in browser clients. Current stable version is 1.1.2. Release cadence is low; the library is stable and rarely updated. Key differentiator: unlike the official grpc-web library which only supports standard error model, this library provides `statusFromError` to extract structured error details (e.g., BadRequest, RetryInfo) comparable to server-side gRPC libraries. ESM-only; requires `google-protobuf` and `grpc-web` as peer dependencies. Ships TypeScript type definitions.
npm install grpc-web-error-details-binNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates using statusFromError to extract structured error details (e.g., BadRequest field violations) from a gRPC-web error with metadata.
Use ES module import syntax (import { ... } from 'grpc-web-error-details').Use the pattern: const [status, details] = statusFromError(err); if (status && details) { ... }Ensure the metadata key in your gRPC-web response is 'grpc-status-details-bin'. The library uses the correct key internally.
Install peer dependencies: npm install google-protobuf @types/google-protobuf grpc-web
Update imports to use the documented named exports. There is no legacy API.
Convert your file to ES module (use import syntax) or change the extension to .mjs.
Use: import { statusFromError } from 'grpc-web-error-details';Run: npm install google-protobuf