File tree 1 file changed +16
-9
lines changed
1 file changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -40,17 +40,20 @@ export const stagehandConfig: ConstructorParams = {
40
40
logLineToString ( message )
41
41
) /* Custom logging function to stderr */ ,
42
42
domSettleTimeoutMs : 30_000 /* Timeout for DOM to settle in milliseconds */ ,
43
- browserbaseSessionCreateParams : {
44
- projectId : process . env . BROWSERBASE_PROJECT_ID ! ,
45
- browserSettings : process . env . CONTEXT_ID
43
+ browserbaseSessionCreateParams :
44
+ process . env . BROWSERBASE_API_KEY && process . env . BROWSERBASE_PROJECT_ID
46
45
? {
47
- context : {
48
- id : process . env . CONTEXT_ID ,
49
- persist : true ,
50
- } ,
46
+ projectId : process . env . BROWSERBASE_PROJECT_ID ! ,
47
+ browserSettings : process . env . CONTEXT_ID
48
+ ? {
49
+ context : {
50
+ id : process . env . CONTEXT_ID ,
51
+ persist : true ,
52
+ } ,
53
+ }
54
+ : undefined ,
51
55
}
52
56
: undefined ,
53
- } ,
54
57
localBrowserLaunchOptions : process . env . LOCAL_CDP_URL
55
58
? {
56
59
cdpUrl : process . env . LOCAL_CDP_URL ,
@@ -168,7 +171,11 @@ export function createServer() {
168
171
content : [
169
172
{
170
173
type : "text" ,
171
- text : `Failed to initialize Stagehand: ${ errorMsg } ` ,
174
+ text : `Failed to initialize Stagehand: ${ errorMsg } . Config: ${ JSON . stringify (
175
+ stagehandConfig ,
176
+ null ,
177
+ 2
178
+ ) } `,
172
179
} ,
173
180
{
174
181
type : "text" ,
You can’t perform that action at this time.
0 commit comments