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,
],
}],
},
});
| Method | Payload | Returns |
|---|---|---|
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
| Method | Payload | Returns |
|---|---|---|
alert | { title, message, ok? } | { dismissed } |
confirm | { title, message, accept?, cancel? } | { confirmed } |
prompt | { title, message?, accept?, cancel? } | { value } |
clipboard
| Method | Payload | Returns |
|---|---|---|
getText | none | { text } |
setText | { text } | { success } |
hasText | none | { hasText } |
notifications
| Method | Payload | Returns |
|---|---|---|
show | { title, body? } | { scheduled } |
requestPermission | none | { 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
| Method | Payload | Returns |
|---|---|---|
getSupport | none | Per-action platform support |
getCurrent | none | { title, width, height, state } |
configure | { title?, width?, height? } | Current window info |
setTitle | { title } | Current window info |
setSize | { width, height } | Current window info |
center | none | Current window info |
maximize | none | Current window info |
minimize | none | Current window info |
restore | none | Current 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
| Method | Payload | Returns |
|---|---|---|
getInfo | none | { appName, packageName, version, build, platform, idiom } |
getTheme | none | { theme } |
Continue with MAUI Essentials or learn how to define your own native contract.