const socket = io("http://immich-server:2283", {The tocken is generated using
path: "/api/socket.io",
transports: ["websocket"],
auth: { token },
});
const response = await fetch(or using, {${IMMICH_API_BASE}/auth/login
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ email: EMAIL, password: PASSWORD }),
});
curl -X POST http://localhost:2283/api/auth/login -H "Content-Type: application/json" -d '{"email":"email@domain","password":"..."}'
[Nest] 25 - 10/31/2025, 8:30:09 AM LOG [Api:WebsocketRepository] Websocket Connect: g1HqIKlUVe2lhaGGAAAFI am using latest immich version
[Nest] 25 - 10/31/2025, 8:30:09 AM ERROR [Api:WebsocketRepository] Websocket connection error: UnauthorizedException: Authentication required
**UnauthorizedException: Authentication required**
at AuthService.validate (/usr/src/app/server/dist/services/auth.service.js:165:15)
...
/usr/src/app/server/node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/cjs/internal/operators/distinctUntilChanged.js:18:28
[Nest] 25 - 10/31/2025, 8:30:09 AM LOG [Api:WebsocketRepository] Websocket Disconnect: g1HqIKlUVe2lhaGGAAAF
cat package.json
{
"name": "immich-ws-listener",
"version": "1.0.0",
"type": "module",
"dependencies": {
"@Immich/sdk": "^2.1.0",
"node-fetch": "^3.3.2",
"socket.io-client": "^4.8.1"
}
}