> ## Documentation Index
> Fetch the complete documentation index at: https://docs.laportenard.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Tauri desktop

> Building and configuring the Tauri v2 desktop app wrapper.

The desktop app wraps the statically exported Next.js app (`out/`) in a Tauri v2 shell located at `nu_pos_react/src-tauri/`.

## Commands

Run from `nu_pos_react/`:

```bash theme={null}
npm run desktop:dev     # Build + launch Tauri dev window
npm run desktop:build   # Build + package Tauri desktop app
```

Both commands run `build:standalone` first, then launch `cargo tauri`.

## Runtime configuration

The Tauri shell injects config into `window.__POS_RUNTIME_CONFIG__` at startup:

| Key                | Default      | Purpose           |
| ------------------ | ------------ | ----------------- |
| `POS_APP_MODE`     | `standalone` | App mode          |
| `POS_API_BASE_URL` | \`\` (empty) | Odoo API base URL |

Pass values via environment variables:

```bash theme={null}
POS_APP_MODE=standalone \
POS_API_BASE_URL=https://odoo.example.com \
npm run desktop:build
```

Or via startup args:

```
--pos-app-mode=standalone
--pos-api-base-url=https://odoo.example.com
```

## CSP and network allowlist

The CSP in `src-tauri/tauri.conf.json` controls which origins the app can connect to. The current policy uses a bare `*` wildcard in `connect-src` to allow connections to any host, including local network hub IPs:

```
connect-src 'self' https://ipc.localhost *
```

<Note>
  The bare `*` is required for Android compatibility. See [Tauri Android](/guides/tauri-android#content-security-policy) for details on why scheme-specific wildcards don't work on Android WebView.
</Note>

## Platform prerequisites

<Tabs>
  <Tab title="macOS">
    * Xcode Command Line Tools: `xcode-select --install`
    * Apple signing identity and notarization credentials for public distribution
  </Tab>

  <Tab title="Windows">
    * MSVC build tools (Visual Studio Build Tools)
    * Code-signing certificate for SmartScreen reputation
  </Tab>

  <Tab title="Linux">
    * `webkit2gtk`, `glib2`, `gtk3`, `librsvg2` development packages
    * Distro-specific signing/repo process for `.deb`/`.rpm` distribution
  </Tab>
</Tabs>

## Update strategy

The app checks for updates on launch via the Tauri updater plugin. See [Auto-updates](/guides/auto-updates) for the full update system documentation.
