Herd's 1445-line llms.txt shows what thorough AI preparation looks like
Herd is a powerful platform and SDK for automating your own browser, ten or millions of them. Similar to Puppeteer but with support for multiple devices and ...
1,445
Lines
+2% vs avg
51
Sections
+113% vs avg
742+
Companies
using llms.txt
2
Files
llms.txt + full
Key Insights
Comprehensive structure
With 51 distinct sections, this file provides thorough coverage for AI systems.
Comprehensive detail
1445 lines of thorough documentation for AI systems.
Two-file approach
Uses both llms.txt and llms-full.txt for different AI use cases.
llms.txt Preview
First 100 lines of 1,445 total
Herd Documentation
==
Herd is a powerful platform and SDK for automating your own browser, ten or millions of them. Similar to Puppeteer but with support for multiple devices and real-time events, and no infrastructure to setup.
Document: Automation Basics
URL: https://herd.garden/docs/automation-basics
# Automation Basics
Welcome to Monitoro Herd! This guide will walk you through creating your first browser automation step-by-step. We'll start with the basics and gradually build up to more complex examples, explaining each concept along the way.
## javascript
## JavaScript SDK
### Setting Up Your Environment
Before writing any code, you'll need to set up your JavaScript environment and install the Herd SDK:
1. Make sure you have Node.js installed (version 14 or higher recommended)
2. Create a new project directory
3. Install the SDK using npm:
Code (bash):
npm install @monitoro/herd
### Initializing the Client
The first step in any automation is to initialize the Herd client with your API credentials:
Code (javascript):
// Import the Herd client
import { HerdClient } from '@monitoro/herd';
// Initialize the client with your API URL and token
const client = new HerdClient('your-token');
// Always initialize the client before using it
await client.initialize();
Note: **Note:** Replace the token with your actual Herd API token from your dashboard.
### Connecting to a Device
After initializing the client, you need to connect to a device (browser) that will perform the automation:
Code (javascript):
// Get a list of available devices
const devices = await client.listDevices();
// Connect to the first available device
const device = devices[0];
console.log(`Connected to device: ${device.id}`);
This code retrieves all devices registered to your account and connects to the first one. In a production environment, you might want to select a specific device based on its properties or availability.
### Creating a Page and Navigating
Now that you're connected to a device, you can create a new browser page and navigate to a website:
Code (javascript):
// Create a new page in the browser
const page = await device.newPage();
// Navigate to a website
await page.goto('https://example.com');
console.log('Successfully navigated to example.com');
The `goto` method loads the specified URL and waits for the page to load. By default, it waits until the page's `load` event is fired, but you can customize this behavior with options.
### Extracting Basic Information
One of the most common automation tasks is extracting information from web pages. Here's how to extract basic elements:
Code (javascript):
// Extract content using CSS selectors
const content = await page.extract({
title: 'h1', // Extracts the main heading
description: 'p', // Extracts the first paragraph
link: 'a' // Extracts the first link text
});
// Display the extracted content
console.log('Extracted content:');
console.log(`Title: ${content.title}`);
console.log(`Description: ${content.description}`);
console.log(`Link: ${content.link}`);
The `extract` method uses CSS selectors to find elements on the page and extract their text content. This is a powerful way to scrape structured data from websites.
### Proper Resource Management
Always remember to close resources when you're done with them to prevent memory leaks:
Code (javascript):
// Close the page when doneHerd is ready for AI search. Are you?
Join 742+ companies preparing their websites for the future of search. Create your llms.txt file in minutes.
Generate Your llms.txtDon't get left behind
Your competitors are preparing for AI search.
Herd has 51 organized sections ready for AI crawlers. Generate your llms.txt file and join the companies optimizing for the future of search.