[Brief 1-2 sentence description explaining what this example does]
[TIME] minute read. [KEY_OUTCOME]
git clone https://github.com/steel-dev/steel-cookbook
cd examples/[EXAMPLE_SLUG]
[INSTALL_STEPS]
cp .env.example .env
# Add your API keys to .env
[RUN_COMMAND]- [Learning Point 1]: Brief explanation
- [Learning Point 2]: Brief explanation
- [Learning Point 3]: Brief explanation
[Clone command]
TypeScript/Node.js:
npm installPython:
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txtThe script will:
- [What happens 1]
- [What happens 2]
- [What happens 3]
Create .env:
STEEL_API_KEY=your_steel_api_key_here
[OTHER_ENV_VARS]Get your free API key: app.steel.dev/settings/api-keys
TypeScript/Node.js:
npm startPython:
python main.pyCustomize by editing [main.py/index.ts]:
TypeScript:
const session = await client.sessions.create({
useProxy: true, // Use Steel's proxy network
solveCaptcha: true, // Enable CAPTCHA solving
sessionTimeout: 1800000, // 30 minute timeout
});Python:
session = client.sessions.create(
use_proxy=True, # Use Steel's proxy network
solve_captcha=True, # Enable CAPTCHA solving
session_timeout=1800000, # 30 minute timeout
)The template includes proper cleanup:
TypeScript:
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);
}Python:
try:
# Your automation code
finally:
# Cleanup runs even if there's an error
if browser:
browser.close()
if session:
client.sessions.release(session.id)