# Smart365Guide Desktop SDK

Public desktop starter SDK for Electron, Tauri, WebView2, Rails, Python webviews, C#/.NET, C++/Qt, and other apps that render a web UI.

This package loads the Smart365Guide browser SDK into your desktop renderer process and gives you a small desktop bridge for platform metadata and native app events.

## Public URLs

- Desktop SDK archive: `https://www.smart365guide.com/downloads/smart365guide-desktop-sdk-1.1.1.zip`
- Desktop SDK script: `https://www.smart365guide.com/downloads/desktop-sdk/smart365guide-desktop.js`
- Browser SDK script: `https://www.smart365guide.com/sdk/smart365guide.js`

## Quick Start

Add the desktop SDK script to your Electron/Tauri/WebView renderer HTML:

```html
<script src="https://www.smart365guide.com/downloads/desktop-sdk/smart365guide-desktop.js"></script>
<script>
  Smart365GuideDesktop.init({
    licenseKey: "lk_your_license_key",
    endpoint: "https://www.smart365guide.com",
    appName: "Acme Desktop",
    platform: "electron",
    theme: "dark",
    position: "bottom-right"
  });
</script>
```

## Supported Stacks

The desktop SDK is a renderer/webview integration, so it works anywhere your app can load JavaScript:

| Stack | Example |
| --- | --- |
| Rust | `examples/rust-tauri/` for Tauri apps |
| Rails | `examples/rails/application.html.erb` |
| Python | `examples/python/pyside6-webengine.py` |
| .NET / C# | `examples/dotnet-csharp/WebView2Smart365Guide.cs` |
| C++ | `examples/cpp-qt/qt-webengine.cpp` |

For each stack, initialize with `licenseKey`, `endpoint`, `appName`, `platform`, `language`, and `framework` so Smart365Guide can segment analytics by integration type.

## Electron Preload

Copy `electron-preload.js` into your Electron app and register it as the BrowserWindow preload script.

```js
const { BrowserWindow } = require("electron");
const path = require("path");

const win = new BrowserWindow({
  webPreferences: {
    preload: path.join(__dirname, "electron-preload.js"),
    contextIsolation: true,
    nodeIntegration: false
  }
});
```

The preload exposes `window.Smart365GuideNative`, which the desktop SDK will use when available.

## API

```ts
const desktop = await Smart365GuideDesktop.init({
  licenseKey: "lk_your_license_key",
  endpoint: "https://www.smart365guide.com",
  appName: "Acme Desktop",
  platform: "electron",
  language: "javascript",
  framework: "electron"
});

desktop.sendDesktopEvent("opened-settings", { source: "menu" });
desktop.startScreenAgent();
desktop.destroy();
```

## Files

- `smart365guide-desktop.js` — browser-compatible desktop bridge loader.
- `smart365guide-desktop.d.ts` — TypeScript declarations.
- `electron-preload.js` — optional Electron preload bridge.
- `package.json` — package metadata if you want to vendor the starter into your app.
- `manifest.json` — public release metadata.
- `examples/` — integration snippets for Rust, Rails, Python, .NET/C#, and C++.

## Notes

This starter is for desktop apps that render HTML/JS. Native OS-level automation requires a signed desktop agent, which should be distributed as a separate platform installer.
