• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
charmaine

charmaine

BraintrustSDK

Quickstart for Braintrust's SDK
Public
Like
BraintrustSDK
Home
Code
2
README.md
tutorial
Branches
1
Pull requests
Remixes
2
History
Environment variables
1
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
2/3/2025
Viewing readonly version of main branch: v20
View latest version
README.md

BraintrustSDK

Steel + Puppeteer Starter This template shows you how to use the Braintrust SDK. This starter templated was ported from this one on GitHub.

Quick start The script shows you how to:

Create and manage a Steel browser session Connect Puppeteer to the session Navigate to a website (Hacker News in this example) Extract data from the page (top 5 stories) Handle errors and cleanup properly View your live session in Steel's session viewer To run it:

Get your free Steel API key at https://app.steel.dev/settings/api-keys Add it to your Val Town Environment Variables as STEEL_API_KEY Click Fork on this val Click Run on this val Writing your automation Find this section in the script:

// ============================================================ // Your Automations Go Here! // ============================================================

// Example automation (you can delete this) await page.goto('https://news.ycombinator.com'); // ... rest of example code You can replace the code here with whatever automation scripts you want to run.

Configuration The template includes common Steel configurations you can enable:

const session = await client.sessions.create({ useProxy: true, // Use Steel's proxy network solveCaptcha: true, // Enable CAPTCHA solving sessionTimeout: 1800000, // 30 minute timeout (default: 15 mins) userAgent: 'custom-ua', // Custom User-Agent }); Error handling The template includes error handling and cleanup:

try { // Your automation code } finally { // Cleanup runs even if there's an error if (browser) await browser.close(); if (session) await client.sessions.release(session.id); } Support Steel Documentation API Reference Discord Community

FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.