@@ -258,127 +258,3 @@ After calling `stagehand.init()`, you receive an `InitResult` object:
258258<ParamField  path = " sessionId"   type = " string"   required >
259259  Unique identifier for the browser session.
260260</ParamField >
261- 
262- ### Code Examples  
263- 
264- <Tabs >
265- <Tab  title = " Browserbase"  >
266- 
267- <CodeGroup >
268- ``` typescript  TypeScript
269- import  { Stagehand  } from  " @browserbasehq/stagehand"  ;
270- 
271- const   stagehand =  new  Stagehand ({
272-   env: " BROWSERBASE"  ,
273-   apiKey: process .env .BROWSERBASE_API_KEY ,
274-   projectId: process .env .BROWSERBASE_PROJECT_ID ,
275-   verbose: 1 ,
276- });
277- 
278- const   { sessionUrl } =  await  stagehand .init ();
279- console .log (` View session at: ${sessionUrl } ` );
280- ``` 
281- 
282- ``` python  Python
283- from  stagehand import  Stagehand
284- import  os
285- 
286- stagehand =  Stagehand(
287-     env = " BROWSERBASE"  ,
288-     api_key = os.environ[" BROWSERBASE_API_KEY"  ],
289-     project_id = os.environ[" BROWSERBASE_PROJECT_ID"  ],
290-     verbose = 1 ,
291- )
292- 
293- result =  await  stagehand.init()
294- print (f " View session at:  { result.session_url} " )
295- ``` 
296- </CodeGroup >
297- 
298- </Tab >
299- <Tab  title = " Local Development"  >
300- 
301- <CodeGroup >
302- ``` typescript  TypeScript
303- import  { Stagehand  } from  " @browserbasehq/stagehand"  ;
304- 
305- const   stagehand =  new  Stagehand ({
306-   env: " LOCAL"  ,
307-   verbose: 2 ,
308-   localBrowserLaunchOptions: {
309-     headless: false ,
310-   },
311- });
312- 
313- const   { debugUrl, sessionId } =  await  stagehand .init ();
314- console .log (` Session: ${sessionId } ` );
315- ``` 
316- 
317- ``` python  Python
318- from  stagehand import  Stagehand
319- 
320- stagehand =  Stagehand(
321-     env = " LOCAL"  ,
322-     verbose = 2 ,
323-     local_browser_launch_options = {
324-         " headless"  : False ,
325-     },
326- )
327- 
328- result =  await  stagehand.init()
329- print (f " Session:  { result.session_id} " )
330- ``` 
331- </CodeGroup >
332- 
333- </Tab >
334- <Tab  title = " Advanced Configuration"  >
335- 
336- <CodeGroup >
337- ``` typescript  TypeScript
338- import  { Stagehand  } from  " @browserbasehq/stagehand"  ;
339- 
340- const   stagehand =  new  Stagehand ({
341-   env: " LOCAL"  ,
342-   modelName: " gpt-4o"  ,
343-   domSettleTimeoutMs: 15000 ,
344-   enableCaching: true ,
345-   selfHeal: true ,
346-   experimental: true ,
347-   localBrowserLaunchOptions: {
348-     headless: false ,
349-     args: [' --no-sandbox'  , ' --disable-setuid-sandbox'  ],
350-     viewport: { width: 1920 , height: 1080  },
351-     ignoreHTTPSErrors: true ,
352-   },
353-   systemPrompt: " You are a helpful web automation assistant."  ,
354-   logInferenceToFile: true ,
355- });
356- 
357- await  stagehand .init ();
358- ``` 
359- 
360- ``` python  Python
361- from  stagehand import  Stagehand
362- 
363- stagehand =  Stagehand(
364-     env = " LOCAL"  ,
365-     model_name = " gpt-4o"  ,
366-     dom_settle_timeout_ms = 15000 ,
367-     enable_caching = True ,
368-     self_heal = True ,
369-     experimental = True ,
370-     local_browser_launch_options = {
371-         " headless"  : False ,
372-         " args"  : [' --no-sandbox'  , ' --disable-setuid-sandbox'  ],
373-         " viewport"  : {" width"  : 1920 , " height"  : 1080 },
374-         " ignore_https_errors"  : True ,
375-     },
376-     system_prompt = " You are a helpful web automation assistant."  ,
377- )
378- 
379- await  stagehand.init()
380- ``` 
381- </CodeGroup >
382- 
383- </Tab >
384- </Tabs >
0 commit comments