HyperAgent
Execute tasks with HyperAgent.
2
Setup your Environment
To use Hyperbrowser with your code, you will need an API Key. You can get one easily from the dashboard. Once you have your API Key, add it to your .env
file as HYPERBROWSER_API_KEY
.
3
Execute a Task
Next, you can have Hyperbrowser execute a task using HyperAgent by simply providing a task.
import { Hyperbrowser } from "@hyperbrowser/sdk";
import { config } from "dotenv";
config();
const hbClient = new Hyperbrowser({
apiKey: process.env.HYPERBROWSER_API_KEY,
});
const main = async () => {
const result = await hbClient.agents.hyperAgent.startAndWait({
task: "What is the title of the top post on Hacker News?",
});
console.log(`Output:\n\n${result.data?.finalResult}`);
};
main().catch((err) => {
console.error(`Error: ${err.message}`);
});
4
View Agent in Dashboard
You can view all of your HyperAgent tasks in the dashboard. You can see what currently running ones are doing live or view information about completed ones.
More information about sessions, including user profiles, web recordings, live view, and more can be found in the Sessions Overview .
To view more details check out the Agents HyperAgent page.
Last updated