File tree 4 files changed +15
-0
lines changed
4 files changed +15
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @browserbasehq/stagehand " : minor
3
+ ---
4
+
5
+ Fixed browserbaseSessionCreateParams not being passed in to the API initialization payload.
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ export class StagehandAPI {
37
37
verbose,
38
38
debugDom,
39
39
systemPrompt,
40
+ browserbaseSessionCreateParams,
40
41
} : StartSessionParams ) : Promise < StartSessionResult > {
41
42
const whitelistResponse = await this . request ( "/healthcheck" ) ;
42
43
@@ -56,6 +57,7 @@ export class StagehandAPI {
56
57
verbose,
57
58
debugDom,
58
59
systemPrompt,
60
+ browserbaseSessionCreateParams,
59
61
} ) ,
60
62
headers : {
61
63
"x-model-api-key" : modelApiKey ,
Original file line number Diff line number Diff line change @@ -393,7 +393,12 @@ export class Stagehand {
393
393
394
394
if ( this . usingAPI && env === "LOCAL" ) {
395
395
throw new Error ( "API mode can only be used with BROWSERBASE environment" ) ;
396
+ } else if ( this . usingAPI && ! process . env . STAGEHAND_API_URL ) {
397
+ throw new Error (
398
+ "STAGEHAND_API_URL is required when using the API. Please set it in your environment variables." ,
399
+ ) ;
396
400
}
401
+
397
402
this . selfHeal = selfHeal ;
398
403
}
399
404
@@ -457,6 +462,7 @@ export class Stagehand {
457
462
verbose : this . verbose ,
458
463
debugDom : this . debugDom ,
459
464
systemPrompt : this . userProvidedInstructions ,
465
+ browserbaseSessionCreateParams : this . browserbaseSessionCreateParams ,
460
466
} ) ;
461
467
this . browserbaseSessionID = sessionId ;
462
468
}
Original file line number Diff line number Diff line change
1
+ import Browserbase from "@browserbasehq/sdk" ;
1
2
import { LogLine } from "./log" ;
2
3
3
4
export interface StagehandAPIConstructorParams {
@@ -19,6 +20,7 @@ export interface StartSessionParams {
19
20
verbose : number ;
20
21
debugDom : boolean ;
21
22
systemPrompt ?: string ;
23
+ browserbaseSessionCreateParams ?: Browserbase . Sessions . SessionCreateParams ;
22
24
}
23
25
24
26
export interface StartSessionResult {
You can’t perform that action at this time.
0 commit comments