Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/webviewjs/webview/llms.txt

Use this file to discover all available pages before exploring further.

WebviewJS (@webviewjs/webview) is a native binding that lets you build cross-platform desktop applications using JavaScript. It wraps tao for windowing and wry for embedded webviews, giving you a lightweight alternative to Electron or Tauri with full Node.js, Deno, and Bun compatibility.

Installation

System requirements and setup for Windows, macOS, and Linux

Quick Start

Create your first native window in under five minutes

API Reference

Full API docs for Application, BrowserWindow, Webview, and more

Guides

IPC messaging, custom protocols, menus, multiple windows, and more

Why WebviewJS?

WebviewJS is designed to be a lightweight, low-overhead binding that keeps the Node.js event loop alive. Unlike frameworks that block the main thread, WebviewJS pumps OS events on a non-blocking interval so timers, I/O, and async work continue running normally.

Non-blocking

Event pumping runs on setInterval — your Node timers and I/O keep working

Cross-platform

Windows, macOS, Linux, iOS, and Android from a single codebase

Typed APIs

Full TypeScript types and EventEmitter APIs for every class

Fetch-compatible IPC

Custom protocols work with Hono, itty-router, and any Fetch API framework

Native UI

System tray icons, native menus, desktop notifications, and file dialogs

Single executables

CLI to compile your app into a standalone binary for Node, Deno, or Bun

Get started in minutes

1

Install the package

npm install @webviewjs/webview
On Linux, also install libwebkit2gtk-4.1-dev and libxdo-dev. See Installation for platform-specific requirements.
2

Create your first window

import { Application } from '@webviewjs/webview';

const app = new Application();

app.whenReady().then(() => {
  const win = app.createBrowserWindow({ title: 'My App', width: 1024, height: 768 });
  win.createWebview({ url: 'https://example.com' });
});
3

Add IPC messaging

const webview = win.createWebview({
  html: '<button onclick="window.ipc.postMessage(\'hello\')">Say Hello</button>',
});

webview.onIpcMessage((msg) => {
  console.log('Page says:', msg.body.toString());
});
4

Build a standalone executable (optional)

webview --build --input ./index.js --output ./dist --name my-app
See Building Executables for cross-compilation and code signing.

Explore the docs

Event Loop

Learn how non-blocking event pumping works and when to use manual mode

IPC Messaging

Send messages between your page and Node with postMessage and expose()

Custom Protocols

Serve local files or use Hono routing without an HTTP server

Platform Notes

Per-platform requirements, known issues, and native extensions

Build docs developers (and LLMs) love