Documentation Index

Fetch the complete documentation index at: /llms.txt

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

Skip to main content
Welcome to the WebviewJS documentation. @webviewjs/webview is a Rust-powered native binding to tao and wry that lets you build desktop applications using Node.js, Deno, or Bun — with real OS windows, the system webview engine, IPC, menus, tray icons, and desktop notifications. Get started in minutes with a single npm install, no Rust toolchain required.

Quick Start

Open a native window and load content in under five minutes.

IPC & Expose

Send messages and call Node.js functions from the browser page.

API Reference

Full reference for Application, BrowserWindow, Webview, and more.

Build Executables

Compile your app to a single self-contained binary with the webview CLI.

Core capabilities

Windows & Webviews

Create, resize, and style native OS windows. Embed any URL or inline HTML using the OS’s own WebKit / WebView2 engine.

IPC Messaging

Page-to-Node messaging via window.ipc.postMessage() and typed async function namespaces via webview.expose().

Custom Protocols

Handle app:// and other custom schemes with a Fetch-compatible handler. Compatible with Hono, itty-router, and similar frameworks.

Native Menus

Build cross-platform menu bars with accelerators, roles, separators, and per-window or global menus.

System Tray

Add tray icons with menus, tooltips, and pointer event listeners on Windows, macOS, and Linux.

Desktop Notifications

Show native OS notifications with a browser-familiar Notification API. Permission is always "granted".

Hello, world

The minimal WebviewJS application — a native window loading a URL:
app.mjs
import { Application } from '@webviewjs/webview';

const app = new Application();

let mainWindow = null;
let mainWebview = null;

app.whenReady().then(() => {
  mainWindow = app.createBrowserWindow({
    title: 'Hello, WebviewJS',
    width: 1024,
    height: 768,
  });

  mainWebview = mainWindow.createWebview({
    url: 'https://nodejs.org',
  });

  app.on('application-close-requested', () => app.exit());
});
Run it with node app.mjs. A native window opens. Close it to exit.
Assistant
Responses are generated using AI and may contain mistakes.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.