@chaty-app/proto
v0.2.33
Published
TypeScript Protobuf bindings for Chaty (Pure ESM)
Downloads
1,883
Readme
@chaty-app/proto
TypeScript Protobuf bindings for Chaty services.
Includes message definitions and gRPC client/server stubs for both Node.js and web browsers.
Installation
npm install @chaty-app/proto
# or
pnpm add @chaty-app/protoUsage
Node.js (gRPC-JS)
import { ChatyServiceClient } from '@chaty-app/proto/service/v1';
import { createChannel } from '@grpc/grpc-js';
const channel = createChannel('localhost:50051');
const client = new ChatyServiceClient(channel);
// Call UsersLogin RPC
const response = await client.usersLogin({
email: '[email protected]',
password: 'password123'
});Browser (gRPC-Web)
import { ChatyServiceClient } from '@chaty-app/proto/web/service/v1';
const client = new ChatyServiceClient({
host: 'http://localhost:8080'
});
// Call UsersLogin RPC
const response = await client.usersLogin({
email: '[email protected]',
password: 'password123'
});Exports
./service/v1- Chaty unified service (authentication, user management)./shared/v1- Shared message definitions./web/service/v1- Browser-compatible gRPC-Web for Chaty service./web/shared/v1- Browser-compatible shared definitions
