web-serial-rxjs wraps the Web Serial API with a minimal, session-oriented RxJS SerialSession so apps can connect, send/receive, and drive UI from state$ and errors$.
SerialSessionRequirements
connect$() from a user gesture (for example a button click). The browser will not open the port picker otherwise.npm install @gurezo/web-serial-rxjs rxjs
import { createSerialSession } from '@gurezo/web-serial-rxjs';
const session = createSerialSession({ baudRate: 115200 });
// Wire this to a button click (user gesture required)
document.getElementById('connect')?.addEventListener('click', () => {
session.connect$().subscribe({
error: (e) => console.error(e),
});
});
session.lines$.subscribe((line) => console.log(line));
Full walkthrough: Quick Start (English) · クイックスタート(日本語)
Shortest path: install, connect from a user action, receive lines, send, and disconnect.
Interactive framework wiring demos for SerialSession (start with Vanilla TS). Not a supported-device catalog — use Recipes for communication patterns.
Open ExamplesFind Guide pages by communication pattern (line protocol, command/reply, timeout, testing, binary send) — not by device brand.
Exported classes, interfaces, types, methods, and API contracts from TypeScript JSDoc.
Open API ReferencePort picker, secure context, subscribe pitfalls, line endings, reconnect, and SerialError checks.
Recommended reading order (overview → quick start → advanced → concepts) and migration notes.
インストール、接続フロー、ライフサイクル、エラーハンドリングなどの利用ガイド。
日本語 Guide を開くInstallation, connection flow, lifecycle, error handling, and usage patterns.
Open English Guide