GuidesIntegrations
Node.js
Use RiftIP with fetch (undici), axios and got.
#fetch with undici
Node's built-in fetch is powered by undici, which accepts a proxy agent as its dispatcher:
JavaScript
import { ProxyAgent, fetch } from "undici";
const { RIFTIP_USER, RIFTIP_PASS } = process.env;
const proxy = (options = "") =>
new ProxyAgent(`http://${options ? `${RIFTIP_USER}-${options}` : RIFTIP_USER}:${RIFTIP_PASS}@gate.riftip.com:7777`);
const res = await fetch("https://ip.riftip.com", { dispatcher: proxy("net-residential-country-us") });
console.log(await res.json());Reuse one agent per session ID — it keeps connections warm and the exit consistent:
JavaScript
const checkout = proxy("session-checkout42-ttl-30m");
await fetch("https://shop.example.com/cart", { dispatcher: checkout });
await fetch("https://shop.example.com/checkout", { dispatcher: checkout });#axios
JavaScript
import axios from "axios";
import { HttpsProxyAgent } from "https-proxy-agent";
const agent = new HttpsProxyAgent(`http://${process.env.RIFTIP_USER}:${process.env.RIFTIP_PASS}@gate.riftip.com:7777`);
const { data } = await axios.get("https://ip.riftip.com", { httpsAgent: agent, proxy: false });#got
JavaScript
import got from "got";
import { HttpsProxyAgent } from "https-proxy-agent";
const agent = { https: new HttpsProxyAgent(`http://${process.env.RIFTIP_USER}:${process.env.RIFTIP_PASS}@gate.riftip.com:7777`) };
const body = await got("https://ip.riftip.com", { agent }).json();Note
With axios, set proxy: false when you pass an agent — otherwise axios applies its own proxy handling on top.