🚧 VeloxKit is pre-release software. APIs may change before v1.0. Get started →
Documentation
Core Concepts
Capability System

Capability System

VeloxKit gates access to native APIs behind capabilities — explicit permissions declared in veloxkit.config.ts.

Why capabilities exist

A VeloxKit app can read files, query databases, make network requests, and access the OS keychain. These are powerful APIs. Capabilities ensure:

  1. No surprise access — an app can't silently exfiltrate files
  2. Auditable permissions — the config is the source of truth
  3. Principle of least privilege — declare only what you need

Declaring capabilities

// veloxkit.config.ts
import { defineConfig } from 'veloxkit'
 
export default defineConfig({
  name: 'my-app',
  capabilities: [
    'fs',       // file system read/write
    'db',       // SQLite
    'network',  // fetch, WebSocket, mDNS
    'clipboard',
  ],
})

What happens without a capability

Capability Demo
velox.config.ts
export default defineConfig({
  capabilities: [
    "db",
  ],
})
db.query('SELECT * FROM notes')
[{ id: 1, title: 'My note', body: '...' }, ...]

The error is thrown at the first call to a gated API, not at build time.

Available capabilities

CapabilityGrants access to
fsvelox.fs — read, write, watch files
dbvelox.db — SQLite queries
networkvelox.network — fetch, WebSocket, mDNS
aivelox.ai — local model inference
audiovelox.audio — playback and recording
clipboardvelox.clipboard — read and write
dialogvelox.dialog — open/save file dialogs
notificationvelox.notification — OS notifications
credentialsvelox.credentials — OS keychain
systemvelox.system — battery, storage, gamepad
deeplinkvelox.deeplink — URL scheme handler
cameravelox.camera — camera device access

Stable — The capability system API is stable and will not change in v0.x releases.

Capability scoping (coming in v0.4)

Future versions will support per-path and per-origin scoping:

capabilities: [
  { name: 'fs', paths: ['~/Documents/my-app/**'] },
  { name: 'network', origins: ['https://api.myservice.com'] },
]

This is tracked in GitHub issue #142 (opens in a new tab).