web-serial-rxjs Documentation
    Preparing search index...

    web-serial-rxjs Documentation

    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$.

    Get started

    1. Install the package
    2. Create a SerialSession
    3. Connect from a user action
    4. Receive and send data

    Requirements

    • Serve the page over HTTPS or localhost (secure context).
    • Call 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) · クイックスタート(日本語)

    Quick Start

    Shortest path: install, connect from a user action, receive lines, send, and disconnect.

    English Quick Start · 日本語クイックスタート

    Examples

    Interactive framework wiring demos for SerialSession (start with Vanilla TS). Not a supported-device catalog — use Recipes for communication patterns.

    Open Examples

    Recipes

    Find Guide pages by communication pattern (line protocol, command/reply, timeout, testing, binary send) — not by device brand.

    English Recipes · 日本語 Recipes

    API Reference (English / TypeDoc)

    Exported classes, interfaces, types, methods, and API contracts from TypeScript JSDoc.

    Open API Reference

    Troubleshooting

    Port picker, secure context, subscribe pitfalls, line endings, reconnect, and SerialError checks.

    English Troubleshooting · 日本語トラブルシューティング

    Guides

    Recommended reading order (overview → quick start → advanced → concepts) and migration notes.

    日本語 Guide

    インストール、接続フロー、ライフサイクル、エラーハンドリングなどの利用ガイド。

    日本語 Guide を開く

    English Guide

    Installation, connection flow, lifecycle, error handling, and usage patterns.

    Open English Guide