A powerful Node.js SDK for the AgentGo headless browser automation platform. Easily manage browser sessions and automate web interactions with a simple, intuitive API.
import { AgentGo } from '@agentgo-dev/sdk';
const client = new AgentGo({
apiKey: 'your_api_key_here',
});
async function example() {
const session = await client.sessions.create({
region: 'US',
keepAlive: true,
});
console.log('Session created:', session.id);
console.log('Connection URL:', session.connectionUrl);
const sessions = await client.sessions.list({
status: 'IDLE',
limit: 10,
});
console.log('Active sessions:', sessions.sessions.length);
const sessionDetails = await client.sessions.retrieve(session.id);
console.log('Session status:', sessionDetails.status);
}
example().catch(console.error);
const { AgentGo } = require('@agentgo-dev/sdk');
const client = new AgentGo({
apiKey: 'your_api_key_here',
});
client.sessions
.create({
region: 'US',
keepAlive: true,
})
.then((session) => {
console.log('Session created:', session.id);
})
.catch(console.error);
const client = new AgentGo({
apiKey: 'your_api_key_here',
});
const client = new AgentGo();
const client = new AgentGo({
apiKey: 'your_api_key_here',
baseURL: 'https://session.browsers.live',
timeout: 30000,
maxRetries: 3,
});
const session = await client.sessions.create({
region?: 'US',
keepAlive?: true
});
const sessions = await client.sessions.list({
status?: 'IDLE',
region?: 'US',
limit?: 20,
});
const session = await client.sessions.retrieve('session-id');
import { AgentGo, AgentGoError } from '@agentgo-dev/sdk';
try {
const session = await client.sessions.create({
region: 'INVALID_REGION',
});
} catch (error) {
if (error instanceof AgentGoError) {
console.log('Error type:', error.type);
console.log('Error message:', error.message);
console.log('Status code:', error.status);
}
}
import { AgentGo, Session, SessionCreateParams } from '@agentgo-dev/sdk';
const client = new AgentGo({ apiKey: 'your_api_key_here' });
const params: SessionCreateParams = {
region: 'US',
keepAlive: true,
};
const session: Session = await client.sessions.create(params);