@monitoro/herd
Version:
Automate your browser, build AI web tools and MCP servers with Monitoro Herd
59 lines (48 loc) • 1.53 kB
JavaScript
export { HerdClient } from './lib/HerdClient.js';
export { Device } from './lib/Device.js';
export { Page } from './lib/Page.js';
export { Node } from './lib/Node.js';
export { HerdMcpServer } from './lib/MCPServer.js';
export { TrailServer } from './lib/trails/server.js';
export { TrailEngine, isRemoteTrailIdentifier, parseTrailIdentifier } from './lib/TrailEngine.js';
// Example usage:
/*
import { HerdClient } from '@herd/sdk';
async function example() {
// Create a client
const client = new HerdClient({
baseUrl: 'http://localhost:3000',
token: 'your-auth-token'
});
// List available devices
const devices = await client.devices();
console.log('Available devices:', devices);
// Get a specific device
const device = await client.device('device-id');
// Create a new page
const page = await device.newPage();
// Navigate to a URL
await page.goto('https://example.com');
// Find and click an element
await page.click('#submit-button');
// Fill a form field
await page.fill('#username', 'testuser');
// Extract data
const data = await page.extract({
title: 'h1',
description: '.description',
items: {
price: '.item-price',
name: '.item-name'
}
});
// Subscribe to page events
const unsubscribe = page.onEvent((event) => {
console.log('Page event:', event);
});
// Cleanup
unsubscribe();
await page.close();
await device.close();
}
*/