// Check browser support if (!isBrowserSupported()) { console.error('Web Serial API is not supported in this browser'); return; }
// Create a serial client constclient = createSerialClient({ baudRate:9600 });
// Connect to a serial port client.connect().subscribe({ next: () =>console.log('Connected!'), error: (error) =>console.error('Connection error:', error), });
web-serial-rxjs
A TypeScript library that provides a reactive RxJS-based wrapper for the Web Serial API, enabling easy serial port communication in web applications.
Features
Browser Support
The Web Serial API is currently only supported in Chromium-based browsers:
Example