Node.js SDK
npm install @proxyhubb/sdk — Connect intents, credentials, and pools.
npm install @proxyhubb/sdk
# optional HTTPS agent helper
npm install https-proxy-agent
Default API: https://api.proxyhubb.com
Buyer proxy: proxy.proxyhubb.com:8090 (override with PROXYHUBB_PROXY_ENDPOINT)
Connect (JWT)
const { ProxyHubClient } = require("@proxyhubb/sdk");
const { HttpsProxyAgent } = require("https-proxy-agent");
const client = new ProxyHubClient({ accessToken: process.env.PROXYHUBB_JWT });
const intent = await client.createSessionIntent("rotating", { targetGeo: "US" });
const proxyUrl = client.sessionIntentProxyUrl(intent.token);
const agent = new HttpsProxyAgent(proxyUrl);
const res = await fetch("https://httpbin.org/ip", { agent });
console.log(await res.json());
Order credentials
const { proxy_credentials } = await client.getOrderCredentials("ORDER_UUID");
const url = client.proxyUrlFromCredentials(proxy_credentials);
Bulk pools
const client = new ProxyHubClient(process.env.PROXYHUBB_API_KEY);
const pool = await client.createPool("scrapers", { size: 5 });
const url = await client.proxyUrlForPool(pool.id);
Common errors
| Symptom | Fix |
|---|---|
Intent create 401/403 | Pass { accessToken }, not only an API key |
fetch ignores proxy | Node’s native fetch needs an agent (https-proxy-agent) or a proxy-aware client |
| Undici / agent warnings | Use a Node version compatible with your agent package, or Axios with proxy: false + agent |
| Wrong exit host in URL | Check PROXYHUBB_PROXY_ENDPOINT |
npm: @proxyhubb/sdk · Protocol notes: Buyer proxy