diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx
index 29b9481..1ebf68c 100644
--- a/src/components/Sidebar.tsx
+++ b/src/components/Sidebar.tsx
@@ -137,11 +137,12 @@ export function Sidebar({ sessions, activeSession, onSwitch, open, onClose }: Pr
);
})}
- {/* Footer glow dots */}
+ {/* Footer with version */}
+ v{__APP_VERSION__}
>
diff --git a/src/globals.d.ts b/src/globals.d.ts
new file mode 100644
index 0000000..41fad5b
--- /dev/null
+++ b/src/globals.d.ts
@@ -0,0 +1 @@
+declare const __APP_VERSION__: string;
diff --git a/src/lib/gateway.ts b/src/lib/gateway.ts
index 26588ea..817bac7 100644
--- a/src/lib/gateway.ts
+++ b/src/lib/gateway.ts
@@ -98,7 +98,7 @@ export class GatewayClient {
this.request(id, 'connect', {
minProtocol: 3,
maxProtocol: 3,
- client: { id: 'webchat', version: '1.0.0', platform: 'web', mode: 'webchat' },
+ client: { id: 'webchat', version: __APP_VERSION__, platform: 'web', mode: 'webchat' },
role: 'operator',
scopes: ['operator.read', 'operator.write'],
caps: [],
@@ -106,7 +106,7 @@ export class GatewayClient {
permissions: {},
auth: { token: this.authToken },
locale: navigator.language || 'en',
- userAgent: 'pinchchat/1.0.0',
+ userAgent: `pinchchat/${__APP_VERSION__}`,
}).then((res) => {
console.log('[GW] connected!', res);
this.connected = true;
diff --git a/vite.config.ts b/vite.config.ts
index b4c8602..23774b6 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -1,8 +1,12 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
+import pkg from './package.json' with { type: 'json' }
export default defineConfig({
+ define: {
+ __APP_VERSION__: JSON.stringify(pkg.version),
+ },
plugins: [react(), tailwindcss()],
build: {
rollupOptions: {