Skip to content

Commit 69913fe

Browse files
authored
pass sdk version number to api for debug (#881)
# why To help debug sessions faster and to respect backwards version compatibility long term # what changed # test plan
1 parent b86df93 commit 69913fe

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

.changeset/proud-weeks-cover.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@browserbasehq/stagehand": patch
3+
---
4+
5+
Pass sdk version number to API for debugging

lib/api.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
StagehandResponseParseError,
2929
} from "../types/stagehandApiErrors";
3030
import makeFetchCookie from "fetch-cookie";
31+
import { STAGEHAND_VERSION } from "./version";
3132

3233
export class StagehandAPI {
3334
private apiKey: string;
@@ -245,6 +246,7 @@ export class StagehandAPI {
245246
"x-model-api-key": this.modelApiKey,
246247
"x-sent-at": new Date().toISOString(),
247248
"x-language": "typescript",
249+
"x-sdk-version": STAGEHAND_VERSION,
248250
};
249251

250252
if (options.method === "POST" && options.body) {

0 commit comments

Comments
 (0)