nestj/client/typescript/README.md
Hellings 3e104ded8d
Some checks are pending
Build and publish / verify (push) Waiting to run
Build and publish / publish (push) Blocked by required conditions
branch(main): Initial commit.
2026-09-12 08:20:46 -04:00

442 B

NestJ TypeScript WebSocket client

The connector uses the plain WebSocket protocol, not Socket.IO.

import { createWebSocketClient } from "./index.js";
const socket = createWebSocketClient("ws://localhost:8080/chat");
socket.onMessage(console.log);
await socket.connect();
socket.send("hello");

Browser builds use the platform WebSocket. Node.js projects can import createNodeWebSocketClient from node.ts, which uses ws.