Rehberler
Masaüstü SDK'lar: macOS, Windows, Linux, Electron, Tauri
macOS, Windows, Linux, Electron veya Tauri için sürümlü SDK'yı kurun, mikrofon iznini bağlayın ve örnek uygulamayı çalıştırın.
Bu sayfada
Install an official desktop SDK, distribution 1.0.4, to show Busymate AI chat in a desktop app, whether native on Windows, Mac or Linux or built with Electron or Tauri. Each section below holds only what differs on that platform, and everything shared is on Native SDKs: the channel, identity, microphone protocol and release rules. Load the chat as the window's top-level page with channel=desktop_sdk, and keep the other supported query parameters.
The microphone adapter is 1.0.0 on every desktop platform. Open a platform's README before you wire callbacks.
macOS
A Swift package for WKWebView on AppKit, with a SwiftUI wrapper. It requires macOS 12 or later and Swift tools 5.9 or later.
- In Xcode choose File › Add Package Dependencies, enter
https://github.com/serebano/busymate-ai-sdk-macos.git, select exact version1.0.4and link theBusymateAIproduct. In a package manifest use.package(url: "https://github.com/serebano/busymate-ai-sdk-macos.git", exact: "1.0.4"). - Present the SDK's chat controller with its AppKit view controller or SwiftUI view, and keep the controller in an
ObservableObject, not in the view. It installs the identity bridge andBusymateMicrophonebefore the first load, pins top-level navigation to your allowed origins, sends other links to the default browser and recovers from web content process termination. - The controller takes
chatURL, abridgeconfiguration,microphone(default on) and an optionalWKWebViewConfiguration. The bridge addsauthCallbackSchemeforASWebAuthenticationSessionsign-in, andminttimes out after 15 seconds. - Add
NSMicrophoneUsageDescriptionand localize it. With the App Sandbox addcom.apple.security.network.clientandcom.apple.security.device.audio-input; with the hardened runtime outside the sandbox add the Audio Input capability. macOS asks at the first tap.
Adapter: BusymateMicrophone.swift, SHA256SUMS, latest. Demo: open example-app/ in Xcode, choose its scheme and My Mac, and run.
Links: source, release, README, configuration, microphone, example app, release manifest.
Windows
A .NET 8 library for Microsoft Edge WebView2 with WPF and WinForms controls. 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.
- The package is not on nuget.org. Download the
.nupkgattached to the release into a local folder, add that folder as a NuGet source and add the package at version1.0.4. Alternatively clone tag1.0.4and add aProjectReferenceto the library project undersrc/. - Use the WPF chat view or WinForms chat panel and call
StartAsync(chatUrl, options). On an existingCoreWebView2, callAttachAsync(core, options)beforeNavigate. - The options are
Identity(null keeps a guest chat),Microphone(null denies microphone and camera),RestrictNavigation,NavigationOrigins,OpenExternalandUserDataFolder. The identity configuration uses PascalCase names, withMintas(request, CancellationToken)and an optionalAppIdthat salts the account hash. The control reports window re-activation asresume. - Windows has no per-app runtime prompt. The adapter re-reads Settings › Privacy & security › Microphone on every tap, can await your own
Confirmconsent dialog, and always denies camera. Reuse the identity origins withForAssistant(assistant, origins).
Adapter: BusymateMicrophone.cs, SHA256SUMS.txt, latest. Demo: run the WPF project in example-app/ with dotnet run --project.
Links: source, release, README, configuration, microphone, example app, release manifest.
Linux
A C library on GTK4 and WebKitGTK 6.0, built with Meson, with GObject Introspection data for Python, GJS, Vala and Rust. It needs GTK 4.10, WebKitGTK 6.0 at 2.42, GLib 2.76, json-glib 1.6 and Meson 1.0, each or later.
- Pin it as a Meson subproject: a
subprojects/wrap file that points at the repository withrevision = 1.0.4, then thedependency(…)line the README gives, withexample=falseandtests=false. Alternatively install system-wide from tag1.0.4withmeson setup,meson compileandmeson install; consumers find it throughpkg-config. - Create the bridge with the mate and origins, connect its signals, install it on your web view and create the microphone adapter once per web view, before
webkit_web_view_load_uri. - Configuration is construct properties (
assistant,origins,app-id) plus signals:get-account, a requiredmintsignal you answer with a fresh token and nonce,action,closeandopen-uri(returnTRUEwhen you opened the URI yourself). Callaccount_changedafter login, logout and account switches. When the web process crashes, the bridge reloads the chat and sendsrestored. - Unsandboxed apps have no per-app runtime prompt; capture goes through WebKitGTK to PipeWire or PulseAudio. Under Flatpak add the
--socket=pulseaudiofinish-arg, and under Snap connectaudio-record. The optionalrequest-permissionsignal lets you show your own consent dialog.
Adapter: busymate-microphone.c, busymate-microphone.h, SHA256SUMS; latest: .c, .h. Demo: run meson setup _build && meson compile -C _build, then the binary under _build/example-app/.
Links: source, release, README, configuration, microphone, example app, release manifest.
Electron
An npm package with a main-process helper that creates the chat window with secure defaults. It needs Electron 30 or later (a peer dependency, for WebContentsView), ships CommonJS and ESM with TypeScript types, and has no runtime dependencies.
- The package is not on the npm registry. Run
npm install https://github.com/serebano/busymate-ai-sdk-electron/releases/download/1.0.4/busymate-ai-electron-1.0.4.tgz, or clone tag1.0.4, build it and install the local folder. - Call the create-chat-window helper (or the
WebContentsViewvariant), thenchat.load(). The window usescontextIsolation, the Chromiumsandbox, nonodeIntegration, no<webview>and a dedicated persistent session. The frozen identity files are byte-identical tohttps://busymate.ai/sdk/v2/2.0.0/electron/. - The options are
url(HTTPS, withchannel=desktop_sdk, its origin allowed),assistant,origins, a requiredappIdthat salts the account hash,account,mintreturning{ token, nonce }ornull,onAction,onClose(for examplechat.window.close()) andmicrophone(defaulttrue;falseloads the identity-only preload). Callchat.accountChanged()after account changes. When the renderer dies the bridge reloads the chat, sendsrestoredand tellsonRenderProcessGone. - On macOS the OS is asked with
systemPreferences.askForMediaAccessat the first tap. In a packaged macOS app addNSMicrophoneUsageDescriptiontoInfo.plist, and with the hardened runtime thecom.apple.security.device.audio-inputentitlement.
Adapter: microphone.ts, preload-microphone.ts, SHA256SUMS; latest: microphone.ts, preload-microphone.ts. Demo: npm ci && npm run build, then cd example-app && npm ci && npm start.
Links: source, release, README, configuration, microphone, example app, release manifest.
Tauri
The tauri-plugin-busymate-ai Rust crate and the optional tauri-plugin-busymate-ai-api JavaScript bindings, for Tauri 2.12 or later and Rust 1.77.2 or later. A Tauri window's own __TAURI_INTERNALS__ never makes it a Busymate AI shell, so the chat keeps its normal layout.
- Add
tauri-plugin-busymate-ai = { git = "https://github.com/serebano/busymate-ai-sdk-tauri", tag = "1.0.4" }tosrc-tauri/Cargo.toml, or download the.cratefile from the release and depend on it by path. Nothing is published to crates.io or npm; the optional frontend bindings install from the release's.tgztogether with@tauri-apps/api. - Register the plugin's
Builderwith youraccount,mintandon_closecallbacks, add.on_permission_request(…)with the plugin'spermission_handler, and open the chat withopen_chat(ChatOptions { url, assistant, origins, .. }). On macOS also forwardon_web_content_process_terminatetoweb_content_process_terminated. The chat opens in its own webview window and the bridge is answered from your Rust side. ChatOptionsalso takesidentityandmicrophone(both default on),title,widthandheight. The builder addson_action,open_url(default: the system browser) andapp_info, whose id salts the account key; only the salted hash ofaccountreaches the chat. Callaccount_changed()(oraccountChanged()from JavaScript) after account changes.- Add the plugin's
defaultpermission only to your own local window's capability. Never addallow-bridgeorallow-microphoneto a capability: the plugin grants them at runtime to the chat window only, for its exact HTTPS origins. - The
on_permission_requesthook is required for the microphone. On macOS addNSMicrophoneUsageDescriptiontosrc-tauri/Info.plist; hardened-runtime and App Store builds also needcom.apple.security.device.audio-input. On Windows the adapter reads the desktop-app microphone privacy settings, and on Linux unsandboxed apps need a working PipeWire or PulseAudio input.
Adapter: microphone.rs, SHA256SUMS, latest. Demo: cd example-app && npm ci && npm run tauri dev.
Links: source, release, README, configuration, microphone, example app, release manifest.
Next steps
- Native SDKs — the channel, identity, microphone and release rules every platform shares.
- Recognize signed-in customers in a desktop app — pass your user's identity to the chat.
- Fix a signed-in customer who shows as a guest — match a symptom to its cause.