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

@capbypass/sdk

v1.0.4

Published

Official TypeScript/JavaScript SDK for CapBypass CAPTCHA solving service

Readme

CapBypass TypeScript/JavaScript SDK

npm version License: MIT TypeScript

Official TypeScript/JavaScript SDK for the CapBypass CAPTCHA solving service. Supports reCAPTCHA v2, reCAPTCHA v3, and AWS WAF challenges.

Works in both Node.js and browser environments.

Features

  • Simple API: One-line solve() method or advanced createTask()/getTaskResult() control
  • 🔄 Automatic Polling: Built-in adaptive polling with exponential backoff
  • 🛡️ Robust Error Handling: Typed errors for all API and network failures
  • 🔁 Smart Retry Logic: Automatic retry on network/gateway errors
  • 🎯 Full TypeScript Support: Complete type definitions for excellent IDE support
  • 🌐 Universal: Works in Node.js and browser environments

Installation

npm install @capbypass/sdk

Quick Start

TypeScript

import { CapBypassClient, TaskType } from '@capbypass/sdk';

const client = new CapBypassClient({ apiKey: 'your-api-key' });

const solution = await client.solve({
  type: TaskType.RECAPTCHA_V2_PROXYLESS,
  websiteURL: 'https://www.google.com/recaptcha/api2/demo',
  websiteKey: '6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-',
}, 120);

console.log('Token:', solution.gRecaptchaResponse);

JavaScript (CommonJS)

const { CapBypassClient, TaskType } = require('@capbypass/sdk');

const client = new CapBypassClient({ apiKey: 'your-api-key' });

client.solve({
  type: TaskType.RECAPTCHA_V2_PROXYLESS,
  websiteURL: 'https://www.google.com/recaptcha/api2/demo',
  websiteKey: '6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-',
}, 120).then(solution => {
  console.log('Token:', solution.gRecaptchaResponse);
});

JavaScript (ES Modules)

import { CapBypassClient, TaskType } from '@capbypass/sdk';

const client = new CapBypassClient({ apiKey: 'your-api-key' });

const solution = await client.solve({
  type: TaskType.RECAPTCHA_V2_PROXYLESS,
  websiteURL: 'https://www.google.com/recaptcha/api2/demo',
  websiteKey: '6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-',
}, 120);

console.log('Token:', solution.gRecaptchaResponse);

API Reference

Client Creation

import { CapBypassClient } from '@capbypass/sdk';

// With API key parameter
const client = new CapBypassClient({ apiKey: 'your-api-key' });

// From CAPBYPASS_API_KEY environment variable
const client = new CapBypassClient();

// With custom base URL
const client = new CapBypassClient({
  apiKey: 'your-api-key',
  baseURL: 'https://custom-gateway.example.com'
});

Simple API (Recommended)

solve() - One-step CAPTCHA solving:

const solution = await client.solve(task, timeout);
  • task: Task configuration (see Task Types below)
  • timeout: Maximum wait time in seconds (default: 120)
  • Returns: Promise

Advanced API

For full control over task lifecycle:

// Create task
const taskId = await client.createTask(task);

// Poll for result
const result = await client.getTaskResult(taskId);

// Check balance
const balance = await client.getBalance();

Task Types

reCAPTCHA v2

const solution = await client.solve({
  type: TaskType.RECAPTCHA_V2_PROXYLESS,
  websiteURL: 'https://example.com',
  websiteKey: '6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-',
}, 120);

Invisible reCAPTCHA v2:

const solution = await client.solve({
  type: TaskType.RECAPTCHA_V2_PROXYLESS,
  websiteURL: 'https://example.com',
  websiteKey: '6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-',
  isInvisible: true,
}, 120);

reCAPTCHA v3

const solution = await client.solve({
  type: TaskType.RECAPTCHA_V3_PROXYLESS,
  websiteURL: 'https://example.com',
  websiteKey: '6LcR_okUAAAAAPYrPe-HK_0RULO1aZM15ENyM-Mf',
  pageAction: 'submit',
}, 120);

AWS WAF Challenge

const solution = await client.solve({
  type: TaskType.ANTI_AWS_WAF_PROXYLESS,
  websiteURL: 'https://example.com',
  awsChallengeJS: 'https://[...].awswaf.com/[...]/challenge.js',
}, 120);

With Proxy

All task types support proxy configuration:

const solution = await client.solve({
  type: TaskType.RECAPTCHA_V2,
  websiteURL: 'https://example.com',
  websiteKey: '6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-',
  proxyType: 'http',
  proxyAddress: 'proxy.example.com',
  proxyPort: 8080,
  proxyLogin: 'username',
  proxyPassword: 'password',
}, 120);

Error Handling

The SDK uses typed errors for precise error handling:

import {
  AuthenticationError,
  InsufficientBalanceError,
  ValidationError,
  TimeoutError,
  SolverError,
  NetworkError,
  GatewayError,
} from '@capbypass/sdk';

try {
  const solution = await client.solve(task, 120);
} catch (error) {
  if (error instanceof AuthenticationError) {
    // Invalid API key
  } else if (error instanceof InsufficientBalanceError) {
    // No balance
  } else if (error instanceof ValidationError) {
    // Invalid task parameters
  } else if (error instanceof TimeoutError) {
    // Task took too long
  } else if (error instanceof SolverError) {
    // CAPTCHA could not be solved
  } else if (error instanceof NetworkError) {
    // Network/connection error
  } else if (error instanceof GatewayError) {
    // Gateway error (502/503/504)
  }
}

Task Type Constants

TaskType.ANTI_AWS_WAF                    // AntiAwsWafTask
TaskType.ANTI_AWS_WAF_PROXYLESS          // AntiAwsWafTaskProxyLess
TaskType.RECAPTCHA_V2                    // ReCaptchaV2Task
TaskType.RECAPTCHA_V2_PROXYLESS          // ReCaptchaV2TaskProxyLess
TaskType.RECAPTCHA_V3                    // ReCaptchaV3Task
TaskType.RECAPTCHA_V3_PROXYLESS          // ReCaptchaV3TaskProxyLess
TaskType.RECAPTCHA_V3_ENTERPRISE         // ReCaptchaV3EnterpriseTask
TaskType.RECAPTCHA_V3_ENTERPRISE_PROXYLESS  // ReCaptchaV3EnterpriseTaskProxyLess

Documentation

📚 Core Documentation

🔧 Advanced Guides

🔄 Migration

Examples

Basic Examples

See the examples directory for complete runnable examples:

Advanced Examples

Full integration examples in the documentation:

  • E-commerce checkout automation
  • Social media automation
  • Web scraping with CAPTCHA handling
  • Microservice integration patterns

Testing

# Run tests
npm test

# Run tests with coverage
npm run test:coverage

# Run tests in watch mode
npm run test:watch

Building

# Build the package
npm run build

# This generates:
# - dist/index.js (CommonJS)
# - dist/index.mjs (ES Module)
# - dist/index.d.ts (TypeScript declarations)

License

MIT License - see LICENSE file for details.

Links