FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
hussufo
hussufosteel_puppeteer_starter
Remix of stevekrouse/steel_puppeteer_starter
Public
Like
steel_puppeteer_starter
Home
Code
2
README.md
S
main.tsx
Branches
1
Pull requests
Remixes
1
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
Sign up now
Code
/
Code
/
Search
README.md

Steel + Puppeteer Starter

This template shows you how to use Steel with Puppeteer to run browser automations in the cloud on Val Town. It includes session management, error handling, and a basic example you can customize. This starter templated was ported from this one on Github.

Quick start

The script shows you how to:

  1. Create and manage a Steel browser session
  2. Connect Puppeteer to the session
  3. Navigate to a website (Hacker News in this example)
  4. Extract data from the page (top 5 stories)
  5. Handle errors and cleanup properly
  6. View your live session in Steel's session viewer

To run it:

  1. Get your free Steel API key at https://app.steel.dev/settings/api-keys
  2. Add it to your Val Town Environment Variables as STEEL_API_KEY
  3. Click Fork on this val
  4. Click Run on this val

Writing your automation

Find this section in the script:

Create val
// ============================================================ // 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:

Create val
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
Code
README.md
S
main.tsx
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.