API Reference
Every Tynd app has three surfaces:
- Backend (
@tynd/core) — imported bybackend/main.ts, exposesapp.start, emitters, lifecycle hooks. - Frontend RPC (
@tynd/core/client) — typed proxy to your backend functions viacreateBackend<typeof backend>(). - OS APIs (
@tynd/core/client) — direct bridge from the frontend to the Rust host: dialog, window, clipboard, shell, notification, tray, process, fs, http, websocket, sql, sidecar, terminal, store, os, path, compute, and more.
Lite vs full parity. All OS APIs live in Rust (packages/host-rs/src/os/) so both runtimes expose the exact same surface. See Runtime Modes for JS-runtime differences.
Backend
@tynd/core—app.start,app.onReady,app.onClose,createEmitter,AppConfig,WindowConfig, menu/tray config.- Streaming RPC — async-generator handlers.
OS APIs
app
Name, version, exit, relaunch.
tyndWindowWindow control, events, multi-window.
monitorsEnumerate displays, scale factors.
dialogNative pickers, message / confirm.
clipboardText / image / HTML.
shellOpen URLs and files in default handler.
notificationNative OS notifications.
traySystem tray + menu.
menuApp menu bar click handlers.
shortcutsGlobal system-wide hotkeys.
fsFilesystem — text, binary, watcher.
pathCross-OS path helpers.
osPlatform, arch, system dirs.
processSubprocess exec + shell exec.
sidecarBundled binaries — resolve runtime path.
storePersistent JSON k/v.
sqlEmbedded SQLite.
httpHTTP client, upload/download progress.
websocketWebSocket client.
terminalReal PTY — cross-OS.
workersOffload CPU-bound JS to OS threads.
computeRust-native hash + CSPRNG.
keyringOS-encrypted secret storage.
autolaunchStart at system boot.
singleInstanceSingle-launch lock + deep links.
updaterEd25519-signed auto-update.
webFetch, WebSocket, crypto, URL — Web globals.
Web-platform re-exports
@tynd/core/client also re-exports the standard Web globals as named exports so import * as tynd surfaces them in one namespace alongside the Tynd OS APIs:
import * as tynd from "@tynd/core/client";
await tynd.fetch(url);
const ws = new tynd.WebSocket(wsUrl);
const hash = await tynd.crypto.subtle.digest("SHA-256", bytes);
await tynd.fs.readText(path); // Tynd OS API on the same namespace
await tynd.sql.open(dbPath);Available re-exports: fetch, Request, Response, Headers, AbortController, AbortSignal, ReadableStream, WebSocket, EventSource, crypto, URL, URLSearchParams, TextEncoder, TextDecoder, atob, btoa, Blob, File, FormData, structuredClone, performance.
Behavior matches the Web spec in both runtimes. In lite they point at Tynd’s polyfills; in full they point at Bun’s native implementations.
Last updated on