콘텐츠로 이동

Node.js SDK

HydraSkill 공식 Node.js SDK입니다.

Terminal window
npm install hydraskill
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',
});
// fetch와 함께 사용
const response = await fetch('https://amazon.com', {
agent: proxy.toAgent(),
});
// 반환
await proxy.release();
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');

내보낸(exported) 타입과 함께 TypeScript를 완벽히 지원합니다.

import { ProxyClient, Proxy, ProxyOptions } from 'hydraskill';
const options: ProxyOptions = {
target: 'amazon.com',
sessionLock: true,
};
const proxy: Proxy = await client.getProxy(options);