@oversteer/automation
v1.0.0
Published
Client SDK for Oversteer web-automation backend.
Maintainers
Readme
Oversteer Automation SDK
Lean TypeScript client for Oversteer web-automation backend. Transport + ergonomics only.
🎉 NEW: We've overhauled the runs framework! The new API uses a browser-use-style pattern with
Runinstances and async methods. See MIGRATION_GUIDE.md for complete details.
Install
npm install @oversteer/automationQuick Start
import { createClient } from '@oversteer/automation';
const client = createClient({
apiKey: process.env.OVERSTEER_API_KEY!,
// baseUrl defaults to 'https://api.oversteer.com'
// Override if needed: baseUrl: 'https://staging.oversteer.com'
});
// Create and run a flow
const run = await client.runs.createRun({
flowId: 'flow_123',
initialVars: { key: 'value' },
});
// Wait for completion and get results
const result = await run.complete();
console.log('Results:', result.results);Usage Patterns
1. Simple Completion (Wait for Results)
const run = await client.runs.createRun({ flowId: 'flow_123' });
const result = await run.complete();
if (result.status === 'succeeded') {
console.log('✓ Success:', result.results);
}2. Stream Progress Updates
const run = await client.runs.createRun({ flowId: 'flow_123' });
// Live step updates
for await (const step of run.stream()) {
console.log(`[${step.index}] ${step.type}: ${step.status}`);
}
// Get final results after streaming
const final = await run.get();
console.log('Results:', final.results);3. Watch All Events
const run = await client.runs.createRun({ flowId: 'flow_123' });
for await (const event of run.watch()) {
switch (event.event) {
case 'step_progress':
console.log('Step:', event.step);
break;
case 'completed':
console.log('Done:', event.results);
break;
}
}4. Create Flows
// Create from prompt
await client.flows.createFromPrompt({
url: 'https://example.com',
prompt: 'Extract all product prices',
});
// Create from steps
await client.flows.create({
url: 'https://example.com',
steps: ['1. Click the search button', '2. Type "query" into search', '3. Extract the results'],
});API
Flows
client.flows.create({ url, name?, steps, options? })- Create a flow from stepsclient.flows.createFromPrompt({ url, prompt, name?, options? })- Create a flow from a prompt
Runs
client.runs.createRun({ flowId, initialVars?, authorMode?, schema? })- Create a new run and return a Run instance
Run Methods
run.complete()- Wait for the run to complete and return resultsrun.stream()- Stream step updates as they happenrun.watch()- Stream all events (steps, artifacts, completion, etc.)run.get()- Get the current status and details of the runrun.cancel()- Cancel the runrun.getRunId()- Get the run ID
Development
npm run build– build ESM+CJS with typesnpm test– run testsnpm run lint– lintnpm run format– format
