Node.js SDK
Node.js SDK
Section titled “Node.js SDK”The official Node.js SDK for HydraSkill.
Installation
Section titled “Installation”npm install hydraskillQuick Start
Section titled “Quick Start”import { ProxyClient } from 'hydraskill';
const client = new ProxyClient({ apiKey: process.env.HYDRASKILL_API_KEY });
const proxy = await client.getProxy({ target: 'amazon.com', sessionLock: true, country: 'US',});
// Use with fetchconst response = await fetch('https://amazon.com', { agent: proxy.toAgent(),});
// Releaseawait proxy.release();With Puppeteer
Section titled “With Puppeteer”import puppeteer from 'puppeteer';import { ProxyClient } from 'hydraskill';
const client = new ProxyClient();const proxy = await client.getProxy({ target: 'amazon.com' });
const browser = await puppeteer.launch({ args: [`--proxy-server=${proxy.toProxyUrl()}`],});
const page = await browser.newPage();await page.authenticate({ username: proxy.username, password: proxy.password });await page.goto('https://amazon.com');TypeScript
Section titled “TypeScript”Full TypeScript support with exported types:
import { ProxyClient, Proxy, ProxyOptions } from 'hydraskill';
const options: ProxyOptions = { target: 'amazon.com', sessionLock: true,};
const proxy: Proxy = await client.getProxy(options);