Lightstreamer Client Web SDK (v9.2.3, stable) enables real-time bidirectional communication with a Lightstreamer server from web browsers. It supports WebSocket fallback options and delivers streaming data updates with low latency. Key differentiators: multiple module formats (UMD, CommonJS, ES Module) for varying bundler compatibility; includes core, full, and MPN builds; provides TypeScript definitions. Maintained by Lightstreamer with frequent releases. Ideal for financial tickers, live dashboards, and collaborative applications.
npm install lightstreamer-client-webVerified import paths — ran on the pinned version, not inferred.
Connects to Lightstreamer demo server, subscribes to three items with MERGE mode, and logs stock updates to console.
Add data-lightstreamer-ns='Ls' to the script tag to create a global Ls object, or omit to inject directly into window.
Use the core build instead (e.g., importScripts('path/to/lightstreamer-core.js')).Use the UMD minified build for direct browser usage, or configure your bundler to minify the output.
Use new Subscription({mode:'MERGE', items:['item1'], fields:['field1']}) instead of positional arguments.Add data-lightstreamer-ns='Ls' to the script tag, or change code to use window.LightstreamerClient directly.
Use the UMD build with a script tag, or add type='module' to the script tag and use an importmap or bundler.
Ensure you call client.connect() before client.subscribe(sub), and check client status via client.addListener({onStatusChange}).No dependency data recorded yet.