npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nestproxy/sdk

v1.0.1

Published

NestProxy Client SDK — TypeScript SDK for NestProxy Residential Proxy API

Readme

NestProxy SDK

TypeScript SDK cho NestProxy Residential Proxy API.

Cài đặt

npm install @nestproxy/sdk

Sử dụng

import { NestProxySDK } from '@nestproxy/sdk';

const sdk = new NestProxySDK({
    apiKey: 'your-api-key-here', // Bắt buộc cho các hàm quản lý Key/User
    // baseUrl: 'https://nestproxy.com/',
});

// Hoặc khởi tạo không cần apiKey nếu chỉ dùng public endpoints
const publicSdk = new NestProxySDK();

// ── Provinces ──
const provinces = await sdk.getProvinces();
const filtered = await sdk.getProvinces('Hà Nội');

// ── Pricing ──
const pricing = await sdk.getPricing();

// ── Proxy Operations ──
const newIP = await sdk.getNewIP('your-proxy-key');
const newIPByProvince = await sdk.getNewIP('your-proxy-key', 1); // Hà Nội
const currentIP = await sdk.getCurrentIP('your-proxy-key');
const removed = await sdk.removeOldIP('your-proxy-key');

// ── Key Management ──
const keys = await sdk.getKeyList();
const detail = await sdk.getKeyDetail('proxy-key-uuid');
const newKeys = await sdk.buyKey({ keyType: 'NORMAL', quantity: 2, duration: 30 });
const renewed = await sdk.renewKey({ proxyKey: 'proxy-key-uuid', duration: 7 });
const deleted = await sdk.removeKey('proxy-key-uuid');

// ── User ──
const user = await sdk.getCurrentUser();

// ── History ──
const ipHistory = await sdk.getIpHistory();
const transactions = await sdk.getTransactions();
const buyOnly = await sdk.getTransactions('BUY');

Error Handling

import { NestProxySDK, NestProxyError } from '@nestproxy/sdk';

try {
    const proxy = await sdk.getNewIP('invalid-key');
} catch (err) {
    if (err instanceof NestProxyError) {
        console.error(err.statusCode); // 404
        console.error(err.message);    // 'Proxy key không hợp lệ'
    }
}

API Reference

| Method | Auth | Return Type | |--------|------|-------------| | getProvinces(search?) | Public | Province[] | | getPricing(domain?) | Public | PricingTier[] | | getNewIP(proxyKey, provinceId?) | Public | ProxyInfo | | getCurrentIP(proxyKey) | Public | ProxyInfo | | removeOldIP(proxyKey) | Public | RemoveIPResponse | | getKeyDetail(proxyKey) | Public | KeyDetail | | getKeyList() | 🔑 API Key | KeyDetail[] | | buyKey(params) | 🔑 API Key | KeyDetail[] | | renewKey(params) | 🔑 API Key | KeyDetail | | removeKey(proxyKey) | 🔑 API Key | RemoveKeyResponse | | getCurrentUser() | 🔑 API Key | UserInfo | | getIpHistory() | 🔑 API Key | IpHistoryEntry[] | | getTransactions(type?) | 🔑 API Key | Transaction[] |

Types

// ── Config ──
interface NestProxyConfig {
    apiKey?: string;    // optional for public endpoints
    baseUrl?: string;   // default: 'https://nestproxy.com/'
    timeout?: number;   // default: 30000ms
}

// ── Province ──
interface Province {
    id: number;
    name: string;       // "Thành phố Hà Nội"
    level: string;      // "Thành phố Trung ương" | "Tỉnh"
}

// ── Proxy ──
interface ProxyInfo {
    proxy: string;          // "103.1.1.2:8080"
    vip: boolean;
    canChangeAt: string;    // ISO timestamp
}

interface CurrentProxyInfo {
    proxy: string | null;
    vip?: boolean;
    message?: string;
    canChangeAt?: string | null;
}

// ── Key ──
type KeyType = 'NORMAL' | 'VIP' | 'VIP_1H';

interface KeyDetail {
    id: number;
    proxyKey: string;       // UUID
    keyType?: KeyType;
    isActive: boolean;
    expiredAt?: string;     // ISO date
    createdAt?: string;
}

interface BuyKeyParams {
    keyType: KeyType;
    quantity?: number;      // default: 1
    duration?: number;      // ngày, default: 1
}

interface RenewKeyParams {
    proxyKey: string;
    duration?: number;      // ngày, default: 1
}

// ── User ──
interface UserInfo {
    id: number;
    userName: string;
    email?: string;
    showName?: string;
    balance: number | string;
    role: string;
    apiKey?: string;
    phoneNumber?: string;
    avatar?: string;          // URL avatar
    createdAt?: string;       // ISO date
    paymentCode?: string;     // Mã nạp tiền
}

// ── History ──
interface IpHistoryEntry {
    id: number;
    proxyKey: string;
    ip: string;
    port: number;
    provinceId?: number;
    createdAt: string;
}

type TransactionType = 'BUY' | 'RENEW' | 'deposit';

interface Transaction {
    id: number;
    amount: number | string;
    quantity?: number;
    keyType?: string;
    status: string;
    description?: string;
    duration?: number;
    transactionType: TransactionType;
    createdAt: string;
}

// ── Pricing ──
interface PricingTier {
    id: number;
    keyType: string;
    duration: number;
    price: number | string;
}

// ── Responses ──
interface RemoveIPResponse   { message: string; success: boolean; released: number; }
interface RemoveKeyResponse  { message: string; success: boolean; }
interface RedeemGiftCodeResponse { success: boolean; amount: string; message: string; }

// ── Error ──
class NestProxyError extends Error {
    statusCode: number;
    error?: string;
}