Skip to content

Getting Started with Webserial

Welcome to the Webserial getting started guide! This guide will walk you through the basics of using the Webserial API to connect and interact with serial devices directly from your web browser.

Before you begin, ensure you have the following:

  • A modern web browser that supports the Webserial API (e.g., Google Chrome, Microsoft Edge).
  • A serial device (e.g., Arduino, microcontroller, or any other device that communicates over serial).
  • Basic knowledge of JavaScript and web development.
  • A secure context (HTTPS) or localhost to run your web application.
  • Familiarity with installing npm packages if you plan to use Webserial via npm.
  • A local server setup (e.g., using Live Server, http-server, or similar) if you’re not using localhost.

You can install Webserial using npm. Open your terminal and run the following command:

Terminal window
npm install @danidoble/webserial

Alternatively, you can include Webserial directly in your project using a CDN:

import * as webserial from 'https://cdn.jsdelivr.net/npm/@danidoble/webserial@latest/dist/webserial.js';