Client
This documents the old v1 API. See Creating a Client for the current version.
The Zocket client (@zocket/client) is a typed WebSocket client that generates methods from your router type.
Basic Usage
Section titled “Basic Usage”import { createZocketClient } from "@zocket/client";import type { AppRouter } from "./server";
const client = createZocketClient<AppRouter>("ws://localhost:3000");
// Listenclient.on.chat.message((msg) => console.log(msg));
// Sendclient.chat.post({ text: "Hi" });