@sylphx/lens-client
v2.7.0
Published
Transport client for Lens API framework
Readme
@sylphx/lens-client
Type-safe client for the Lens API framework with real-time subscriptions.
Installation
bun add @sylphx/lens-clientUsage
import { createClient, WebSocketTransport } from "@sylphx/lens-client";
import type { AppRouter } from "./server";
const client = createClient<AppRouter>({
transport: new WebSocketTransport("ws://localhost:3000"),
});
// Query
const user = await client.user.get({ id: "1" });
// Mutation
const result = await client.user.create({ name: "John", email: "[email protected]" });
// Subscription
client.user.get({ id: "1" }).subscribe((user) => {
console.log("User updated:", user);
});License
MIT
Built with @sylphx/lens-core, @sylphx/lens-server, and @sylphx/reify.
✨ Powered by Sylphx
