--- title: "تثبيت حزمة SDK لـ Windows وإعدادها" description: "ثبّت حزمة SDK لـ Windows بإصدار محدد، واضبط الهوية وإذن الميكروفون، ثم ابنِ التطبيق النموذجي." last_updated: "2026-10-13T16:35:20+03:00" --- # تثبيت حزمة SDK لـ Windows وإعدادها Source: https://busymate.ai/ar/docs/guides/windows-sdk Last modified: 2026-10-13T16:35:20+03:00 Integrate Busymate AI in a Windows desktop app using the official Windows SDK distribution **1.0.1**: a .NET 8 library for Microsoft Edge WebView2, with WPF and WinForms controls. Source, the configuration reference and a buildable demo live in the [public repository](https://github.com/serebano/busymate-ai-sdk-windows/tree/1.0.1), released as [1.0.1](https://github.com/serebano/busymate-ai-sdk-windows/releases/tag/1.0.1). Identity uses protocol v2 / bridge build 2.0.0; microphone uses protocol v1 / adapter 1.0.0. The [release manifest](https://github.com/serebano/busymate-ai-sdk-windows/blob/1.0.1/release-manifest.json) pins the source hashes. Its `CONTRACT-v2.md` hash matches `https://busymate.ai/sdk/v2/2.0.0/SHA256SUMS`. ## 1. Install the pinned version 1. Download the `.nupkg` attached to the 1.0.1 release into a local folder, add that folder as a NuGet source, then add the package at version `1.0.1` as the README shows. The package is not on nuget.org. Alternatively, clone the repository at tag `1.0.1` and add a `ProjectReference` to the library project under `src/`. 2. Target `net8.0-windows` on Windows 10 or 11 with the WebView2 Runtime installed (Windows 11 ships it). The package depends on `Microsoft.Web.WebView2` 1.0.2903.40 or a compatible newer version. 3. Use the SDK's WPF chat view or WinForms chat panel and call `StartAsync(chatUrl, options)`. On an existing `CoreWebView2`, call the SDK's `AttachAsync(core, options)` before `Navigate`. Both bridges are installed before the first navigation. Read the [versioned installation instructions](https://github.com/serebano/busymate-ai-sdk-windows/blob/1.0.1/README.md) before wiring callbacks. ## 2. Load the chat as the window's page Use the chat URL and assistant slug from your workspace, for example `https://YOUR_ASSISTANT.busymate.ai/?channel=desktop_sdk&locale=en`. Keep the URL's supported parameters and set `channel=desktop_sdk`. The chat is the window's top-level page: it uses the normal chat layout and shows your `locale` from the first frame. Do not use `channel=embed`, which needs an allowed parent web page and refuses to start as a window, or `channel=desktop`, which is reserved for the Busymate AI desktop app. Allow only exact HTTPS origins, without wildcards. The assistant slug adds exactly `https://.busymate.ai`. Add `https://busymate.ai` when you load a `/support/` URL, and add your mapped support host if you have one. ## 3. Configure every supported callback The chat options take `Identity` (null keeps a guest chat), `Microphone` (null denies microphone and camera), `RestrictNavigation`, `NavigationOrigins`, `OpenExternal` and `UserDataFolder`. The identity configuration takes: | Setting | Purpose | | --- | --- | | `Assistant` | Required assistant slug. | | `Origins` | Extra exact HTTPS chat origins. | | `Account` | Current account ID, or null when signed out. | | `Mint` | Required backend callback `(request, CancellationToken)` returning a fresh token and matching nonce. | | `OnAction` | Optional app action handler; return true only when handled. | | `OnClose` | Optional host dismissal callback. | | `AppId` | Optional stable app id that salts the account hash. | Your backend must sign the supplied nonce with ES256, a unique `jti` and an expiry within 120 seconds. Never ship signing keys, cache launch tokens or log tokens. See [backend signing](https://busymate.ai/ar/docs/guides/identity-backend-signing) and the [complete configuration reference](https://github.com/serebano/busymate-ai-sdk-windows/blob/1.0.1/docs/configuration.md). ## 4. Wire the OS microphone callback Call `AccountChanged()` after login, logout and account switches. The control reports window re-activation as `resume` and recovers from renderer and browser process failures. Desktop Windows apps get no per-app runtime prompt. The adapter re-reads Settings › Privacy & security › Microphone (device access, microphone access and desktop-app access) on every tap. It can optionally await your own `Confirm` consent dialog, and allows only WebView2 microphone requests from an allowed origin. Camera is always denied. Reuse the identity origins for the adapter with the SDK's `ForAssistant(assistant, origins)` helper. A mic or voice tap sends `busymate.microphone.v1.request` with `id` and `source`. The SDK obtains OS permission and returns `{ id, granted }`. Chat waits for that reply before capture or voice token minting. Denial and timeout fail closed, and cancellation prevents a delayed grant from starting a cancelled session. Opening the chat never asks. See [microphone lifecycle and troubleshooting](https://github.com/serebano/busymate-ai-sdk-windows/blob/1.0.1/docs/microphone.md). ## 5. Build and test the demo On Windows with the .NET 8 SDK, run the WPF project in `example-app/` with `dotnet run --project`. Its settings panel changes the chat URL, locale, origins, guest or identified mint, microphone, consent dialog and close callbacks. Follow the [example-app build instructions](https://github.com/serebano/busymate-ai-sdk-windows/blob/1.0.1/example-app/README.md). Guest chat needs no fake identity, and authenticated tests use your own backend. The event log helps with integration troubleshooting without exposing credentials. Knowledge, tools, handoff, branding and voice availability are workspace features. Locale and appearance follow the supported hosted chat parameters. The SDK does not invent native flags for these services. ## Verify 1. Build the example app and verify guest chat, loaded with `channel=desktop_sdk`. 2. Load `?channel=desktop_sdk&locale=de`: the first frame is in German and the chat fills the window with no extra title-bar inset. 3. Use your backend to test sign-in, logout and account switching without history leakage. 4. On a real machine, test the first mic/voice grant, denial, retry after changing the OS setting, and cancellation while the prompt is open. 5. Test external links, close/action callbacks, window re-activation and renderer recovery. ### Which version should I install? Windows SDK distribution 1.0.1, the NuGet package attached to the release. There is no legacy v1 identity bridge on Windows. ### Does the demo authenticate without my backend? No. Guest mode works when your workspace allows it; authenticated mode requires your real backend and a current session. ### Which updates require an app release? SDK changes, OS permission declarations and native capabilities require an app release. Hosted chat changes arrive from the service.