A library to easily interact with PSocket servers from the client.
import { PSocketClient } from "@psocket/client";
const client = new PSocketClient({
url: "/psocket/"
});
const response: Response = await client.fetch("https://api.example.com/");
console.log(await response.json());
const ws: WebSocket = await client.connect("wss://example.com/");
ws.onopen = () => {
ws.send("Hello World!");
}