fix: inject app version from package.json instead of hardcoded 1.0.0

- Add Vite define for __APP_VERSION__ from package.json
- Use dynamic version in gateway connect handshake and userAgent
- Show version number in sidebar footer
- Add globals.d.ts type declaration
This commit is contained in:
Nicolas Varrot
2026-02-12 09:37:28 +00:00
parent 7905f64f37
commit 3c5fcdfc73
4 changed files with 9 additions and 3 deletions

View File

@@ -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;