npm install @ws-asyncapi/clientDesigned to work with @ws-asyncapi/cli
npx @ws-asyncapi/cli http://localhost:3005/asyncapi.jsonimport { websocketAsyncAPI } from "@ws-asyncapi/client";
const client = websocketAsyncAPI("ws://localhost:3005/test");
client.onEvent("response", (data) => {
console.log(data.name);
});
client.onClose((data) => {
console.log(data);
});
client.onOpen(() => {
console.log("connected");
});
await client.opened;
client.call("test", {
name: "test",
});