For the complete documentation index, see llms.txt. This page is also available as Markdown.

SDK NodeJS

The 9Proxy SDK provides a Node.js wrapper (Node-API addon) for managing residential proxy sessions, port forwarding, authentication, and automatic rotation/renewal.

This document describes the Node-API layer only. Each API method is exported from the native addon and can be invoked directly in your Node.js application.

Quick Start

// quick start

const sdk = require('./build/Release/addon.node');
sdk.initialize('nineproxylibs');

function callOrThrow(fn, ...args){
  const rc = fn(...args);
  if (typeof rc === 'number' && rc !== 0){
    throw new Error(sdk.sdkGetLastError?.() || `SDK error rc=${rc}`);
  }
  return rc;
}

Except for forwarded port information, the SDK does not persist settings (API host, SDK path, port ranges, configured ports). Your app must store these and reapply them to the SDK on each startup.

Typical Flow

Start -> Run SDK -> Set settings (API/ports) -> Restore saved data -> [Close Application] -> Shutdown()

Example Implementation

Last updated

Was this helpful?