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 🙏

© 2025 – Pkg Stats / Ryan Hefner

roxy-browser-api

v0.1.0

Published

TypeScript client for the Roxy Browser API - programmatic control over browser windows with fingerprint management and proxy support

Downloads

71

Readme

Roxy Browser API Client

A TypeScript client library for the Roxy Browser API that provides programmatic control over browser windows with advanced fingerprint management and proxy support.

Features

  • 🎭 Fingerprint Management - Create and manage browser fingerprints for privacy and automation
  • 🌐 Proxy Support - Configure proxies for each browser window
  • 🚀 Browser Automation - Full control over browser window lifecycle
  • 📦 TypeScript First - Complete type definitions for all API operations
  • 🔄 Multiple Formats - Supports both CommonJS and ES Modules
  • Modern Runtime - Built with Bun, works with Node.js

Installation

npm install roxy-browser-api

or with your preferred package manager:

# Using pnpm
pnpm add roxy-browser-api

# Using yarn
yarn add roxy-browser-api

# Using bun
bun add roxy-browser-api

Quick Start

1. Get Your API Token

First, obtain your API token from the Roxy Browser dashboard.

2. Configure Environment Variables

Create a .env file in your project root:

ROXY_API_TOKEN=your_api_token_here
ROXY_API_BASE_URL=http://127.0.0.1:50000

3. Basic Usage

import { RoxyBrowserClient } from "roxy-browser-api";

async function main() {
  // Initialize the client (automatically reads from environment variables)
  const client = new RoxyBrowserClient();

  // Get list of workspaces
  const workspaceData = await client.getWorkspace({
    page_index: 1,
    page_size: 10,
  });

  console.log(`Found \${workspaceData.total} workspaces`);

  // Create a new browser window
  const browserWindow = await client.createBrowser({
    workspaceId: workspaceData.rows[0].id,
    windowName: "My Test Browser",
    fingerInfo: {
      language: "en-US",
      timeZone: "America/New_York",
    },
  });

  console.log(`Created browser window: \${browserWindow.windowId}`);

  // Open the browser and get automation endpoints
  const openResult = await client.openBrowser({
    workspaceId: workspaceData.rows[0].id,
    dirId: browserWindow.dirId,
  });

  console.log(`WebSocket endpoint: \${openResult.ws}`);
  console.log(`HTTP endpoint: \${openResult.http}`);
}

main().catch(console.error);

API Reference

Client Initialization

// Using environment variables
const client = new RoxyBrowserClient();

// Or provide credentials directly
const client = new RoxyBrowserClient("your_api_token", "http://127.0.0.1:50000");

Workspace Management

Get Workspaces

const workspaces = await client.getWorkspace({
  page_index: 1,
  page_size: 10,
});

Browser Window Operations

Create Browser Window

const browserWindow = await client.createBrowser({
  workspaceId: 123,
  windowName: "My Browser",
  fingerInfo: {
    language: "en-US",
    timeZone: "America/New_York",
    isLanguageBaseIp: false,
    isTimeZone: false,
  },
  proxyInfo: {
    // Optional proxy configuration
    proxyType: "http",
    proxyHost: "proxy.example.com",
    proxyPort: 8080,
  },
});

Open Browser Window

const connection = await client.openBrowser({
  workspaceId: 123,
  dirId: "window_dir_id",
  args: ["--remote-allow-origins=*"], // Optional browser launch arguments
});

// Use the WebSocket endpoint with Puppeteer or other automation tools
console.log(connection.ws); // WebSocket endpoint
console.log(connection.http); // HTTP endpoint
console.log(connection.driver); // ChromeDriver path

Get Browser List

const browsers = await client.getBrowserList({
  workspaceId: 123,
  page_index: 1,
  page_size: 20,
});

Update Browser Window

await client.updateBrowser({
  workspaceId: 123,
  dirId: "window_dir_id",
  windowName: "Updated Name",
  fingerInfo: {
    language: "es-ES",
  },
});

Close Browser Window

await client.closeBrowser({
  workspaceId: 123,
  dirIds: ["window_dir_id_1", "window_dir_id_2"],
});

Delete Browser Window

await client.deleteBrowser({
  workspaceId: 123,
  dirIds: ["window_dir_id"],
});

Fingerprint Management

Randomize Fingerprint

await client.randomizeFingerprint({
  workspaceId: 123,
  dirId: "window_dir_id",
});

Cache Management

Clear Local Cache

await client.clearLocalCache({
  workspaceId: 123,
  dirIds: ["window_dir_id"],
});

Clear Server Cache

await client.clearServerCache({
  workspaceId: 123,
  dirIds: ["window_dir_id"],
});

Account and Label Management

Get Accounts

const accounts = await client.getAccount({
  workspaceId: 123,
  page_index: 1,
  page_size: 10,
});

Get Labels

const labels = await client.getLabel({
  workspaceId: 123,
});

TypeScript Support

This library is written in TypeScript and provides complete type definitions for all API operations. All request and response types are exported for your convenience:

import type {
  RoxyBrowserClient,
  CreateBrowserRequest,
  CreateBrowserResponse,
  FingerInfo,
  ProxyInfo,
  // ... and many more
} from "roxy-browser-api";

Integration with Puppeteer

After opening a browser window, you can connect to it using Puppeteer:

import puppeteer from "puppeteer-core";
import { RoxyBrowserClient } from "roxy-browser-api";

const client = new RoxyBrowserClient();

// Create and open browser
const workspace = await client.getWorkspace();
const browser = await client.createBrowser({
  workspaceId: workspace.rows[0].id,
  windowName: "Puppeteer Test",
});

const connection = await client.openBrowser({
  workspaceId: workspace.rows[0].id,
  dirId: browser.dirId,
});

// Connect Puppeteer to the remote browser
const puppeteerBrowser = await puppeteer.connect({
  browserWSEndpoint: connection.ws,
});

const page = await puppeteerBrowser.newPage();
await page.goto("https://example.com");

// Your automation code here...

await puppeteerBrowser.disconnect();

Error Handling

The client throws errors for API failures. Always wrap your calls in try-catch blocks:

try {
  const result = await client.createBrowser({
    workspaceId: 123,
    windowName: "Test",
  });
} catch (error) {
  if (error instanceof Error) {
    console.error("API Error:", error.message);
  }
}

Environment Variables

  • ROXY_API_TOKEN (required) - Your Roxy Browser API authentication token
  • ROXY_API_BASE_URL (optional) - API base URL (defaults to http://127.0.0.1:50000)

Requirements

  • Node.js 18+ or Bun 1.0+
  • TypeScript 5.0+ (for TypeScript projects)

License

MIT

Support

For API documentation and support, visit Roxy Browser Documentation.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.