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;
}Typical Flow
Start -> Run SDK -> Set settings (API/ports) -> Restore saved data -> [Close Application] -> Shutdown()
Example Implementation
Last updated
Was this helpful?