Registry / devops / service-apis-node

service-apis-node

JSON →
library2.2.3jsnpmunverified

Generated gRPC client and server interfaces for Digitalkin's service APIs, providing type-safe Node.js bindings. Current stable version is 2.2.3, with releases tied to API updates. Key differentiators include full TypeScript support, ESM-first module system, and auto-generated service definitions. The library depends on @grpc/grpc-js v1.13.3 peer dependency for gRPC communication.

npm install service-apis-node
INSTALL
IMPORT
SIG · SERVICE-APIS-NODE
S
service-apis-node
devopsjavascriptv2.2.3
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.

ServiceClient
import { ServiceClient } from 'service-apis-node'
const { ServiceClient } = require('service-apis-node')
ESM-only module; CommonJS require() will fail with ERR_REQUIRE_ESM.
ServiceServer
import { ServiceServer } from 'service-apis-node'
import ServiceServer from 'service-apis-node'
Named export, not default export.
MessageTypes
import type { MessageTypes } from 'service-apis-node'
import { MessageTypes } from 'service-apis-node'
Use 'import type' for type-only imports to avoid runtime overhead.

Shows how to initialize both gRPC client and server using the generated interfaces with TypeScript.

import { ServiceClient, ServiceServer } from 'service-apis-node'; import { credentials } from '@grpc/grpc-js'; // Create a client const client = new ServiceClient( 'localhost:50051', credentials.createInsecure() ); // Start a server const server = new ServiceServer(); server.bindAsync('0.0.0.0:50051', credentials.createInsecure(), () => { server.start(); console.log('Server running on port 50051'); });
Debug
Known issues
breakingESM-only import: CommonJS require() will throw ERR_REQUIRE_ESM.
fix
Convert project to ESM or use dynamic import().
affects: >=2.0.0
deprecatedVersion 1.x used default export; v2 uses named exports.
fix
Update imports to use named exports as shown in documentation.
affects: =2.0.0
gotchagRPC channel credentials must match server; insecure credentials are for development only.
fix
Use credentials.createSsl() for production.
affects: all
gotchaService definitions are auto-generated and may change between patch versions.
fix
Pin exact version in package.json to avoid breaking changes from API updates.
affects: >=2.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported.
Using CommonJS require() to load an ESM-only package.
fix
Use import statement or dynamic import() in your module.
TypeError: ServiceClient is not a constructor
Incorrect import; library is ESM-only and may require named import.
fix
Change import to: import { ServiceClient } from 'service-apis-node'.
Error: 14 UNAVAILABLE: failed to connect to all addresses
gRPC server not running or unreachable.
fix
Ensure server is started and accessible, check host:port.
Upgrade
Version history
2.2.3latest on npm
Audit
Dependencies
@grpc/grpc-jsrequiredPeer dependency required for gRPC client/server functionality
Agent activity
8 hits · last 30 days
node
6
Amazon
1
OpenAI (training)
1
Resources
service-apis-node — npm install service-apis-node · libregistry