@chanx-js/client
chanx
Type-safe WebSocket client for chanx AsyncAPI schemas, with topic multiplexing. Zero dependencies, with optional bindings for React, Vue, Svelte and Solid, and first-class support for plain JavaScript and Node.
Documentation · Getting started · API reference
pnpm add @chanx-js/client
pnpm add -D @chanx-js/codegen
npx @chanx-js/codegen http://localhost:8000/asyncapi.json -o src/generated
import { createClient } from '@chanx-js/client';
import { chat } from './generated';
const client = createClient({ baseUrl: 'wss://api.example.com' });
const connection = client.connect(chat, { params: { room: 'lobby' } });
connection.on('chat_notification', (message) => console.log(message.payload.message));
connection.send({ action: 'chat', payload: { message: 'hello' } });
| Import | For |
|---|---|
@chanx-js/client |
The runtime: clients, connections, topics |
@chanx-js/client/react |
useChannel, useTopics |
@chanx-js/client/vue |
Composables returning refs |
@chanx-js/client/svelte |
Stores, for Svelte 4 and 5 |
@chanx-js/client/solid |
Signals and accessors |
MIT licensed.
Related Packages
asyncapi-cable
Generate typed AnyCable channel clients from an AsyncAPI 3.0 document (Vue + Rea...
9,750
1
@isbatak/ark-wheel-picker
Ark UI style wheel-picker components for React, Solid, Vue and Svelte, built on...
771
2
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 0.1.2 | >=3.4 | MIT | |
| 0.1.1 | >=3.4 | MIT | |
| 0.1.0 | >=3.4 | MIT |