Senxor.js is a TypeScript/JavaScript SDK for communicating with Meridian Innovation's Senxor thermal imaging devices.
It provides a small set of packages that separate core protocol and processing logic from transport implementations so you can use the same high-level API across different environments.
@senxor/core: core protocol, Senxor class, processors, and error types.@senxor/web-serial: browser transport using the Web Serial API.@senxor/capacitor-serial: transport for Capacitor apps (for example, Android).@senxor/serial-core: internal/shared serial transport core for building new transports.
GitHub: https://github.com/MeridianInnovation/senxor-js
Core SDK that defines:
- The
Senxorclass for controlling a device session (start/stop, reading data, lifecycle management). - Processing helpers (processors) for working with Senxor data.
- Error types and utilities.
You normally use this together with one of the transport packages (Web Serial or Capacitor). See the @senxor/core README for details on the Senxor API, processors, and error handling.
Browser-only transport that uses the Web Serial API to talk to Senxor devices from a web page.
- Runs in modern browsers that support
navigator.serial(for example, Chromium-based browsers). - Lets you list available serial devices, request access from the user, and work with a
Senxorinstance for each connected device.
Typical usage:
- Install
@senxor/coreand@senxor/web-serial. - Use
@senxor/web-serialto request and select a Senxor device and then use theSenxorinstance it gives you.
See the @senxor/web-serial README for concrete usage examples and environment requirements.
Transport for Capacitor apps, for example an Android app using a WebView.
- Relies on a Capacitor serial plugin to access serial ports from the native side.
- Exposes helpers to list and connect to Senxor devices from your Capacitor app and gives you a
Senxorinstance for each connection.
See the @senxor/capacitor-serial README for setup steps in a Capacitor project and usage examples.
Shared, environment-agnostic serial transport core used by both Web Serial and Capacitor transports.
- Provides abstractions like
SerialTransportBase,ISerialPort, and shared types/utilities for Senxor serial communication. - Intended for advanced users who want to implement custom transports, for example for Node.js or custom gateways.
Most end users do not need to depend on this package directly. See the @senxor/serial-core README if you are building a new transport.
Senxor.js is published as multiple packages on npm. You install only what you need for your environment.
pnpm add @senxor/core @senxor/web-serialpnpm add @senxor/core @senxor/capacitor-serial
# plus the required Capacitor serial plugin (see that plugin's documentation)This repository is a pnpm workspace:
packages/core–@senxor/corepackages/web-serial–@senxor/web-serialpackages/capacitor-serial–@senxor/capacitor-serialpackages/serial-core–@senxor/serial-coreexamples/web-serial– Vite example app using@senxor/web-serialexamples/capacitor-serial– Vite plus Capacitor example app using@senxor/capacitor-serial
If you are developing inside this repository:
-
Install dependencies:
pnpm install
-
Build all packages and examples:
pnpm build
-
Run tests:
pnpm test -
Type-check:
pnpm typecheck
-
Lint:
pnpm lint
For package-specific commands, for example only @senxor/core, you can use pnpm filters, for example:
pnpm test --filter @senxor/core- For device control, processors, and error handling: see
packages/core/README.md. - For browser-based usage: see
packages/web-serial/README.md. - For Capacitor-based usage: see
packages/capacitor-serial/README.md. - For implementing custom transports: see
packages/serial-core/README.md.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.