Docs Reference
Alpha documentation — APIs may change between 0.x releases.

Built-in native capabilities

Import these generated proxies from @vidra-dev/sdk. Grant every method the frontend uses in vidra.config.ts; importing a proxy does not enable it.

filesystem

Filesystem methods require a resource scope rather than a general method grant:

import {
  defineConfig,
  filesystemRoots,
  native,
  within,
} from "@vidra-dev/sdk/config";

export default defineConfig({
  bridge: {
    filesystem: [{
      root: within(filesystemRoots.documents, "MyApp"),
      allow: [
        native.filesystem.readText,
        native.filesystem.writeText,
      ],
    }],
  },
});
MethodPayloadReturns
readText{ path }{ content }
writeText{ path, content }{ success }
exists{ path }{ exists }
delete{ path }{ success }
listDirectory{ path }{ entries: [{ name, isDirectory }] }
import { filesystem } from "@vidra-dev/sdk";

const { content } = await filesystem.readText({
  path: absolutePathInsideConfiguredDocumentsScope,
});

The payload path must be fully qualified. The native host resolves the symbolic root and rejects traversal or symbolic links outside the configured scope.

dialogs

MethodPayloadReturns
alert{ title, message, ok? }{ dismissed }
confirm{ title, message, accept?, cancel? }{ confirmed }
prompt{ title, message?, accept?, cancel? }{ value }

clipboard

MethodPayloadReturns
getTextnone{ text }
setText{ text }{ success }
hasTextnone{ hasText }

notifications

MethodPayloadReturns
show{ title, body? }{ scheduled }
requestPermissionnone{ granted }

Request permission before showing a notification:

import { notifications } from "@vidra-dev/sdk";

const permission = await notifications.requestPermission();
if (permission.granted) {
  await notifications.show({ title: "Done", body: "Export complete" });
}

On macOS, permission and delivery require a correctly signed app. On Android 13 and newer, requestPermission triggers the POST_NOTIFICATIONS prompt; Android 8 and newer deliver through the vidra.general channel. Scaffolded apps ship a monochrome vidra_notification status-bar icon; keep that drawable when you replace the launcher icon.

appWindow

MethodPayloadReturns
getSupportnonePer-action platform support
getCurrentnone{ title, width, height, state }
configure{ title?, width?, height? }Current window info
setTitle{ title }Current window info
setSize{ width, height }Current window info
centernoneCurrent window info
maximizenoneCurrent window info
minimizenoneCurrent window info
restorenoneCurrent window info
setFullscreen{ enabled }Current window info

Events:

  • appWindow.onResized(handler)
  • appWindow.onStateChanged(handler)

getCurrent, title changes, and size changes work on Windows and macOS. Window-state actions vary by platform; call getSupport() and hide unsupported controls.

On Android the appWindow contract stays registered so contract fingerprints match across platforms, but only getCurrent is supported. Every other action reports false from getSupport() and throws when called.

app

MethodPayloadReturns
getInfonone{ appName, packageName, version, build, platform, idiom }
getThemenone{ theme }

Continue with MAUI Essentials or learn how to define your own native contract.