docs: add nested try/finally cleanup to root TypeScript README example (#2726)
TE
2mo ago+40+40+01234567890123456789-32-32-01234567890123456789
Summary
- Fixes #2726
- Updates the canonical TypeScript example in
README.mdto use nestedtry/finallyblocks, ensuringstagehand.close()andbrowser.close()are called on both success and error. - Aligns root quickstart with Python and Go READMEs and prevents billable Browserbase session leaks.
Summary by cubic
Fixes #2726 by updating the root TypeScript README example to use nested try/finally blocks, so stagehand.close() and browser.close() run on both success and error. This aligns the quickstart with the Python and Go READMEs and prevents billable Browserbase session leaks.