@ejazullah/smart-browser-automation
Version:
A smart AI-driven browser automation library and REST API server using MCP (Model Context Protocol) and LangChain for multi-step task execution. Includes both programmatic library usage and HTTP API server for remote automation.
28 lines (21 loc) • 806 B
JavaScript
// Even simpler JavaScript example - minimal setup
import { SmartBrowserAutomation, HuggingFaceConfig } from '@ejazullah/smart-browser-automation';
async function minimalExample() {
// Simple configuration
const config = new HuggingFaceConfig('your-api-key');
const automation = new SmartBrowserAutomation();
try {
// Initialize
await automation.initialize(config, 'http://localhost:3000', 'ws://localhost:9222');
// Execute task
const result = await automation.executeTask("Go to Google and search for 'hello world'");
// Check result
console.log('Success:', result.success);
console.log('Steps taken:', result.steps);
} catch (error) {
console.error('Error:', error.message);
} finally {
await automation.close();
}
}
minimalExample();