Getting started
Create a desktop app with a standard web frontend and a C#/.NET native host.
Prerequisites
- .NET 10 SDK
- The .NET MAUI workload
- Node.js 18 or newer
- Xcode when targeting macOS; Windows targets must be built on Windows
Install the MAUI workload:
dotnet workload install maui
Scaffold an app
npm create vidra-app@latest
Choose a project name and reverse-domain app ID when prompted. The generated project contains:
ui/— the web app.src/<App>.Host/— the .NET MAUI host and your C# contracts.ui/src/generated/— TypeScript generated from those C# contracts.
The vidra CLI is installed locally in the project. No global install is
required.
Check your environment
cd my-app
npm run doctor
doctor checks the .NET SDK, MAUI workload, platform tooling, and signing
prerequisites. When something is missing, it prints the command needed to fix it.
Run the app
npm run dev
Vidra starts Vite and the native host together with hot reload. Edit the web UI or supported C# code and the running app updates; Vidra handles platform-specific recovery automatically.
The scaffold demonstrates all three bridge directions:
- UI buttons call built-in C# modules such as
app,clipboard, andnotifications. - C# calls a generated JavaScript
countercontract. - Native window and hot-reload events update the web UI.
Common commands
npm run dev # web UI + native host with hot reload
npm run build # package for the current platform
npm run doctor # verify the development environment
npx vidra run # launch the native host only
npx vidra dev --target windows # run a specific desktop target
npx vidra build --target macos # build a specific desktop target
Preview a build without running it:
npx vidra build --target macos --plan
Add your first contract
Next, call C# from JavaScript. You will add a native method, register it with the host, and use the generated TypeScript proxy from the UI.