SDK reference

Build with your own tools

The VibeOS Dev SDK lets you build apps in VS Code, Cursor or any editor, with plain HTML or a framework like Vite and React. Your local page gets a working window.vos — files, AI and network — and one command turns the result into a .vibe app.

Overview

PieceWhat it does
vibeos-dev.jsProvides window.vos on localhost. Switches itself off inside VibeOS and the IDE preview.
vibeos.d.tsTypeScript definitions for every window.vos method and event.
vibeos-pack.mjsInlines your built JS/CSS into one page, removes the dev runtime, checks vibe.json and writes a .vibe file.
Starter kitA start page, four focused examples (files, AI, network, permissions) with live results and copyable helpers, a blank my-app folder, the four sample apps, plus all of the above.

Quickstart

1

Download the starter kit

Grab the starter kit or add the dev runtime to an existing page:

html
<!-- In <head>, before your own scripts -->
<script src="https://apps.vibeoscloud.com/sdk/v1/vibeos-dev.js"
        data-manifest="./vibe.json"></script>
2

Describe your app in vibe.json

The same fields as a .vibe manifest, without html. icon can point to an image file; the packager embeds it. Permissions here are enforced in dev mode exactly like VibeOS enforces them.

json
{
  "name": "My VibeOS App",
  "description": "Saves notes and asks the AI for ideas.",
  "iconEmoji": "✨",
  "iconBg": "linear-gradient(135deg,#10b981,#0ea5e9)",
  "icon": "./icon.png",
  "version": "1.0.0",
  "permissions": {
    "read": ["home/Documents"],
    "write": ["home/Documents"],
    "ai": true,
    "network": ["https://api.open-meteo.com/v1"]
  }
}
3

Serve it locally

Double-click index.html, or run any local server, for example npx serve . or python3 -m http.server 5173. A double-clicked page can't read vibe.json, so permissions are only checked when served — or when the manifest is inside the page (see Configuration).

4

Use window.vos

Like inside VibeOS, window.vos may arrive after your script runs, so wait for vos-ready:

javascript
function vosReady() {
  return window.vos
    ? Promise.resolve(window.vos)
    : new Promise((r) => addEventListener("vos-ready", () => r(window.vos), { once: true }));
}

const vos = await vosReady();
await vos.fs.writeFile("home/Documents", "hello.md", "# Hi from localhost");
const reply = await vos.ai.chat([{ role: "user", content: "Say hello" }]);

Sample apps

Complete apps you can open, read and change. Each download has an index.html with the dev script tag, a vibe.json, a README and the packager. Double-click index.html to run it; AI Chat and News Reader also need a developer key.

AppUsesWhat it showsDownload
To-Do ListFilesLists, due dates, priorities and progress, saved as one JSON file. Reloads when the file changes elsewhere.todo.zip
File BrowserFilesBrowse, create, rename, delete, upload and download files, with a text editor and Markdown preview.file-browser.zip
AI ChatFiles + AISaved conversations, assistant styles, code blocks and clear messages for sign-in, plan and credit problems.ai-chat.zip
News ReaderFiles + NetworkRSS and Atom feeds with unread counts, stars, keyboard shortcuts and a clean reading view.news-reader.zip

Get them all in vibeos-samples.zip — they're also in the starter kit's samples folder.

Double-click or serve?

Opened as a file, the browser won't let the page read vibe.json, so dev mode allows every folder and URL and the badge says permissions aren't checked. Serve the folder (npx serve .), or put the manifest inside the page, to have them enforced exactly like VibeOS does.

Developer keys

Files work straight away. AI and network calls run through VibeOS under your account, so they need a developer key. Create one in Dashboard → Developer SDK, then click the VibeOS dev badge in the corner of your page and paste it (or run vosDev.setKey("vdk_…") in the console).

  • The key is saved in your browser, not your code, so it can't leak into a submitted app.
  • Keys only work from localhost, 127.0.0.1 and file:// pages.
  • AI calls use your own plan and AI credits, with the same messages for sign-in, plan and credit problems.
  • Revoke a key any time; pages using it lose AI and network access immediately.

How dev mode behaves

APIIn dev modeDifferences from VibeOS
vos.fsA virtual home folder saved in this browser and shared by every dev app on the same address, like VibeOS. home/.apps/<id> stays private. Changes in another tab fire vos-fs-change. The VibeOS dev badge lists every file and shows its contents.Files aren't your real VibeOS files and don't sync across devices.
vos.aiReal VibeOS AI under your account.None — same model, limits and plan checks.
vos.netProxied server-side like VibeOS: no CORS issues, private addresses blocked, auth and cookie headers stripped, 15 s timeout, 5 MB cap.None.
vos.appName, id and permissions from vibe.json. sandboxPath is home/.apps/<id>.The id is your app's name until it has an App Center id.

No permissions yet? Dev mode is relaxed

If vibe.json has no permissions, dev mode allows every folder and URL and prints a console warning. Add permissions before you ship — VibeOS only allows what you declare.

Errors reject with a plain Error carrying only a message, the same as in VibeOS. See Errors & limits.

Vite, React & TypeScript

Put the dev script tag in your index.html and copy vibeos.d.ts into src/. Nothing to install from npm, and no imports: window.vos is provided at runtime.

typescript
// src/main.ts — works the same in dev, in VibeOS and after packaging
/// <reference path="./vibeos.d.ts" />

const vos = await new Promise<VibeOS.Vos>((resolve) =>
  window.vos ? resolve(window.vos) : addEventListener("vos-ready", () => resolve(window.vos!), { once: true }),
);
const notes = await vos.fs.readDir("home/Documents");

Assets

A .vibe app is one HTML document. The packager inlines local JS and CSS; images, fonts and other files must be inlined as data: URLs (Vite: build.assetsInlineLimit), stored with vos.fs, or loaded from a URL in your network permissions. Keep the page under 2 MB.

Package & submit

bash
# plain HTML project
node vibeos-pack.mjs index.html vibe.json

# Vite / Parcel / any build that outputs dist/
npm run build
node vibeos-pack.mjs dist/index.html vibe.json -o my-app.vibe

Upload the .vibe file on Submit App, or try it on your own desktop first via VibeOS → App Center → Install from File. You can also open the file in the IDE to keep editing there.

Configuration

To keep permissions checked on a double-clicked page, put the manifest inside the page, before the dev script. The packager removes it, and uses it as your manifest when there's no vibe.json.

html
<script type="application/json" id="vibe-manifest">
  { "name": "My App", "permissions": { "read": ["home/Documents"], "write": ["home/Documents"] } }
</script>
<script src="https://apps.vibeoscloud.com/sdk/v1/vibeos-dev.js"></script>

Script attributes: data-manifest, data-badge="false". Or set window.VIBEOS_DEV before the script loads:

html
<script>
  // Optional — set before vibeos-dev.js loads
  window.VIBEOS_DEV = {
    manifest: "./vibe.json",   // or manifestData: { ...inline manifest }
    badge: false,              // hide the corner badge
  };
</script>
<script src="https://apps.vibeoscloud.com/sdk/v1/vibeos-dev.js"></script>

Dev helpers

window.vosDev exists only in dev mode — never call it from app code you ship.

javascript
vosDev.setKey("vdk_…")     // save a developer key in this browser
vosDev.clearKey()
vosDev.files()              // every file the app saved, as { path: content }
vosDev.exportFiles()        // JSON string — handy for fixtures
vosDev.importFiles(json)    // load fixtures; fires vos-fs-change
vosDev.resetFiles()         // start from an empty home folder
vosDev.status()             // version, key, file count and where permissions came from