Skip to content

Commit 6c37995

Browse files
committed
feat: include CLI version in user agent string
1 parent 2d01317 commit 6c37995

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/APIClient.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import type {
99
APISimStartParams,
1010
PinReadResponse,
1111
} from "./APITypes.js";
12+
import { readVersion } from "./readVersion.js";
1213

1314
const DEFAULT_SERVER =
1415
process.env.WOKWI_CLI_SERVER ?? "wss://wokwi.com/api/ws/beta";
@@ -38,8 +39,12 @@ export class APIClient {
3839
}
3940

4041
private createSocket(token: string, server: string) {
42+
const { sha, version } = readVersion();
4143
return new WebSocket(server, {
42-
headers: { Authorization: `Bearer ${token}` },
44+
headers: {
45+
Authorization: `Bearer ${token}`,
46+
"User-Agent": `wokwi-cli/${version} (${sha})`,
47+
},
4348
});
4449
}
4550

0 commit comments

Comments
 (0)