Registry / communication / remotivelabs-grpc-web-stubs

remotivelabs-grpc-web-stubs

JSON →
library0.0.12jsnpmunverified

Remotivelabs-grpc-web-stubs provides generated JavaScript/TypeScript gRPC-web stubs for RemotiveBroker, enabling browser-based gRPC calls via gRPC-web. Version 0.0.12 is current. Key differentiator: pre-generated stubs for RemotiveBroker API, eliminating manual protoc compilation. Uses @improbable-eng/grpc-web for transport. Minimal dependencies and ESM-first distribution.

npm install remotivelabs-grpc-web-stubs
INSTALL
IMPORT
SIG · REMOTIVELABS-GRPC-
R
remotivelabs-grpc-web-stubs
communicationjavascriptv0.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.

GrpcWebStubs
import { GrpcWebStubs } from 'remotivelabs-grpc-web-stubs'
const GrpcWebStubs = require('remotivelabs-grpc-web-stubs');
Package uses ESM; named export for the main client class.
Visibility
import { Visibility } from 'remotivelabs-grpc-web-stubs/visibility_pb'
import { Visibility } from 'remotivelabs-grpc-web-stubs'
Message types are in subpaths matching the proto file name (e.g., visibility_pb).
VisibilityClient
import { VisibilityClient } from 'remotivelabs-grpc-web-stubs/visibility_pb_service'
import { VisibilityClient } from 'remotivelabs-grpc-web-stubs'
Service clients are exported from *_pb_service subpaths.

Example of creating a GrpcWebStubs client, constructing a Visibility request, and making a gRPC-web call to RemotiveBroker.

import { GrpcWebStubs } from 'remotivelabs-grpc-web-stubs'; import { Visibility } from 'remotivelabs-grpc-web-stubs/visibility_pb'; const client = new GrpcWebStubs({ baseUrl: process.env.REMOBROKER_URL ?? 'http://localhost:8080', apiKey: process.env.REMOBROKER_API_KEY ?? '', }); const req = new Visibility(); req.setName('example'); client.getVisibility(req).then(res => { console.log('Visibility:', res.toObject()); }).catch(err => { console.error('Error:', err); });
Debug
Known issues
breakingVersion 0.0.12 introduced a breaking change in the client constructor signature to accept a single configuration object instead of multiple parameters.
fix
Update to use `new GrpcWebStubs({ baseUrl, apiKey })` instead of `new GrpcWebStubs(baseUrl, apiKey)`.
affects: >=0.0.12
deprecatedThe `setBaseUrl()` method on client instances is deprecated and will be removed in a future release; use the constructor option instead.
fix
Pass baseUrl via the constructor configuration object.
affects: >=0.0.10
gotchaImports for message types (e.g., `Visibility`) must be from `*/visibility_pb` and not from the main package index.
fix
Use named subpath imports: `import { Visibility } from 'remotivelabs-grpc-web-stubs/visibility_pb'`.
affects: >=0.0.0
gotchaThe package requires both `google-protobuf` and `@improbable-eng/grpc-web` as runtime dependencies; ensure they are installed.
fix
Run `npm install google-protobuf @improbable-eng/grpc-web`.
affects: >=0.0.0
deprecatedPromise-based method return values changed from raw gRPC response objects to wrapper objects containing `.response` in version 0.0.11.
fix
Access response via `.response` property: `result.response.toObject()`.
affects: >=0.0.11
Errors
Common errors & fixes
Cannot find module 'remotivelabs-grpc-web-stubs/visibility_pb'
Subpath imports not enabled or package not resolved correctly
fix
Ensure package version >=0.0.12 and import path is correct. Also check if your bundler supports package.json exports field.
TypeError: GrpcWebStubs is not a constructor
Using default import instead of named import
fix
Use `import { GrpcWebStubs } from 'remotivelabs-grpc-web-stubs'` (named import).
Error: Cannot read properties of undefined (reading 'toObject')
Response object structure changed in v0.0.11; trying to call toObject on raw gRPC response instead of wrapper
fix
Access `response.response.toObject()` if using version >=0.0.11.
Upgrade
Version history
0.0.12latest on npm
Audit
Dependencies
google-protobufrequiredProtobuf runtime library required by generated stubs
@improbable-eng/grpc-webrequiredgRPC-web transport client for browser/Node.js
@types/google-protobufoptionalTypeScript type definitions for google-protobuf
Agent activity
17 hits · last 30 days
node
14
OpenAI (training)
1
Resources
remotivelabs-grpc-web-stubs — npm install remotivelabs-grpc-web-stubs · libregistry