Registry / messaging / wechaty-grpc

wechaty-grpc

JSON →
library1.0.1jsnpmunverified

gRPC service definitions and client for Wechaty, the chatbot SDK. Version 1.0.1 stable release, maintained with regular updates. Provides protobuf-based RPC for puppet-host communication, enabling cross-language chatbot backends. Ships TypeScript types and supports Node >=16. Key differentiator: seamless integration with Wechaty ecosystem for scaling chatbot operations via gRPC.

npm install wechaty-grpc
INSTALL
IMPORT
SIG · WECHATY-GRPC
W
wechaty-grpc
messagingjavascriptv1.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.

WechatyGrpc
import { WechatyGrpc } from 'wechaty-grpc'
const WechatyGrpc = require('wechaty-grpc').WechatyGrpc
ESM support since v1.0; CJS require with .default needed in some builds
Puppet
import { Puppet } from 'wechaty-grpc/puppet'
import { Puppet } from 'wechaty-grpc'
Puppet types are exported from subpath; main exports only service definitions
GrpcOptions
import type { GrpcOptions } from 'wechaty-grpc'
Type import for TypeScript users avoiding runtime overhead

Connects to a Wechaty gRPC puppet host, sends a message, and disconnects.

import { WechatyGrpc } from 'wechaty-grpc'; import { Puppet } from 'wechaty-grpc/puppet'; const client = new WechatyGrpc({ token: process.env.WECHATY_TOKEN || '', puppet: Puppet.create({ endpoint: 'localhost:8788' }) }); await client.start(); console.log('gRPC client connected'); // send message await client.sendMessage({ to: 'contact@example.com', text: 'Hello from gRPC!' }); await client.stop();
Debug
Known issues
breakinggRPC library changed from grpc to @grpc/grpc-js in v1.0
fix
Use @grpc/grpc-js instead of grpc; update your package.json dependencies
affects: <1.0
deprecatedPuppet.create() is deprecated; use new Puppet() constructor
fix
Replace Puppet.create({...}) with new Puppet({...})
affects: >=1.0
gotchaEnvironment variable WECHATY_TOKEN must be set before creating client
fix
Ensure process.env.WECHATY_TOKEN is defined or pass token option explicitly
affects: >=1.0
breakingRemoved support for Node <16
fix
Upgrade Node to version 16 or higher
affects: >=1.0
gotchaProtobuf definitions must match server version exactly; mismatch causes silent failure
fix
Ensure wechaty-grpc version matches the puppet host's grpc version
affects: >=1.0
Errors
Common errors & fixes
Error: Cannot find module 'protobufjs'
Missing protobufjs runtime dependency
fix
Run npm install protobufjs --save
TypeError: WechatyGrpc is not a constructor
Using wrong import style (CommonJS vs ESM)
fix
Use import { WechatyGrpc } from 'wechaty-grpc' or const { WechatyGrpc } = require('wechaty-grpc')
Error: 12 UNIMPLEMENTED: Method not found
gRPC method not available on the server
fix
Ensure puppet host is running and supports requested method; check version compatibility
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies
protobufjsrequiredruntime dep for protobuf serialization
grpc-jsoptionalgRPC client library
Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
1
Resources
wechaty-grpc — npm install wechaty-grpc · libregistry