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 lightweight native binding that lets you build cross-platform desktop applications from Node.js, Deno, or Bun. It wraps tao for native OS windowing and wry for embedded webviews, giving you real system windows with a web UI — without the overhead of a full framework like Electron or Tauri.

Highlights

Non-blocking event loop

Events are pumped on a setInterval so Node timers, async I/O, and await all keep working normally while the window is open.

Cross-platform

Windows (WebView2), macOS (WebKit), Linux (WebKitGTK), iOS, and Android — all from a single npm package.

Typed EventEmitter APIs

Every class (Application, BrowserWindow, Webview, TrayIcon) uses a typed EventEmitter interface with full TypeScript support.

IPC without ceremony

Pages talk to Node via window.ipc.postMessage(). Use webview.expose() for Promise-based typed calls.

Fetch-compatible protocols

Serve local content with custom protocols that accept Fetch Request and return Response — Hono and any other Fetch router works directly.

Native UI primitives

System tray icons with menus, native desktop notifications, file dialogs, and per-window or global menu bars.

Shared browser contexts

Isolate cookies, cache, and storage across webviews using WebContext — great for multi-profile or private browsing.

Standalone executables

Bundle your app into a single self-contained binary using the built-in webview CLI — supports Node, Deno, and Bun runtimes.

Core concepts

WebviewJS has three main objects that you work with in every app:
ClassRole
ApplicationRoot object. Owns the event loop, windows, menus, and tray icons.
BrowserWindowAn OS-level window. Controls size, position, decorations, and menus.
WebviewThe embedded browser inside a window. Handles navigation, IPC, cookies, and DevTools.
import { Application } from '@webviewjs/webview';

const app = new Application();

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

Scope of this library

WebviewJS is a lightweight system webview binding for JavaScript. It does not aim to be a full-featured framework like Electron or Tauri. It exposes the underlying OS webview (WebView2, WebKit, WebKitGTK) directly — no bundled Chromium, no renderer process isolation.
This means:
  • Smaller binaries — no bundled browser engine
  • System rendering — pages render in the platform’s default browser engine
  • Less abstraction — you control the window and webview directly

Supported platforms

PlatformArchitectureStatus
Windows (WebView2)x64, x86, arm64✅ Supported
macOS (WebKit)x64, arm64✅ Supported
Linux (WebKitGTK)x64, arm64, armv7✅ Supported
Linuxx86⚠️ No CI
Androidarm64, armv7⚠️ Experimental
FreeBSDx64⚠️ No CI

Get started

Installation

Platform requirements, npm install, and building from source

Quick Start

Create your first native window in under five minutes

Event Loop

Learn how the non-blocking pump works and when to use manual mode

API Reference

Full reference for Application, BrowserWindow, Webview, and more

Build docs developers (and LLMs) love