WebSocket client implementation for the liwi real-time query and subscription system. Version 12.0.0 requires Node 18.12+. Provides a client for connecting to liwi-resources backends over WebSocket, enabling live queries, resource subscriptions, and mutations. Key differentiator: integrates seamlessly with the liwi ecosystem (liwi-resources-server, liwi-resources-optimistic), supporting offline resilience, optimistic updates, and automatic reconnection. Released as ESM-only, with bundled TypeScript types.
npm install liwi-resources-websocket-clientNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a WebSocket client, subscribes to a resource query, performs a mutation, and unsubscribes.
Use dynamic import() or change to ESM project (type: module in package.json).
Upgrade Node.js to >=18.12.0
Replace autoReconnect with reconnect in client options.
Ensure a valid token is passed in the client options, or handle connection errors.
Always import from 'liwi-resources-websocket-client'.
Convert your file to ESM (use import/export, add type: module to package.json) or use dynamic import().
Use .then/.catch on mutation results, not .subscribe.
Provide a valid token via the options.token field.