Registry / communication / action-grpc

action-grpc

JSON →
library1.0.1jsnpmunverified

A Node.js library that implements the Action Protocol over gRPC, providing an abstract layer for microservice communication. Version 1.0.1 is the latest stable release; the project appears to be in early stages with infrequent updates. It enables defining actions, data, and token fields in gRPC payloads for service-to-service messaging. Differentiators include a simple JSON-like action format and automatic code generation via `npm run generate`.

npm install action-grpc
INSTALL
IMPORT
SIG · ACTION-GRPC
A
action-grpc
communicationjavascriptv1.0.1
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.

ActionService
import { ActionService } from 'action-grpc'
const { ActionService } = require('action-grpc')
ESM import – library uses ES modules.
ActionClient
import { ActionClient } from 'action-grpc'
const ActionClient = require('action-grpc').ActionClient
Named export, not default.
actionDefinition
import { actionDefinition } from 'action-grpc'
import actionDefinition from 'action-grpc'
Exported as named, not default.

Shows how to create a gRPC client and invoke an action with token authentication.

import { ActionClient } from 'action-grpc'; const client = new ActionClient('localhost:50051'); const payload = { action: 'createCar', data: { brand: 'Ferrary', color: 'red' }, token: process.env.TOKEN ?? 'mytokensecret' }; client.invoke(payload, (err, response) => { if (err) console.error(err); else console.log(response); });
Debug
Known issues
gotchaToken field is required in payload; missing token will cause authentication failure.
fix
Include a 'token' field in the payload object.
affects: >=1.0
gotchagRPC server must be running before client invocation; client will throw 'Unavailable' error otherwise.
fix
Ensure the server is started with `ActionService` before calling client methods.
affects: >=1.0
breakingVersion 1.0.0 introduced breaking changes in payload structure – 'action' field renamed from 'type'.
fix
Use 'action' instead of 'type' in the payload.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Failed to load gRPC binary module because it was not installed
Missing or incompatible gRPC native module for the current platform.
fix
Run `npm rebuild grpc` or install platform-specific package like `grpc` build tools.
TypeError: client.invoke is not a function
Importing a wrong export from 'action-grpc'.
fix
Use `import { ActionClient } from 'action-grpc'` and create an instance.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
67 hits · last 30 days
node
56
OpenAI (training)
1
Resources
action-grpc — npm install action-grpc · libregistry