@capbypass/sdk 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -1
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +7 -2
- package/dist/index.mjs +6 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
[](https://www.typescriptlang.org/)
|
|
6
6
|
|
|
7
|
-
Official TypeScript/JavaScript SDK for the [CapBypass](https://capbypass.pro) CAPTCHA solving service. Supports reCAPTCHA v2, reCAPTCHA v3,
|
|
7
|
+
Official TypeScript/JavaScript SDK for the [CapBypass](https://capbypass.pro) CAPTCHA solving service. Supports reCAPTCHA v2, reCAPTCHA v3, AWS WAF challenges, and Cloudflare Turnstile.
|
|
8
8
|
|
|
9
9
|
Works in both Node.js and browser environments.
|
|
10
10
|
|
|
@@ -184,6 +184,32 @@ const solution = await client.solve({
|
|
|
184
184
|
}, 120);
|
|
185
185
|
```
|
|
186
186
|
|
|
187
|
+
### Cloudflare Turnstile
|
|
188
|
+
|
|
189
|
+
`websiteURL` and `websiteKey` are required. `action` (1 to 32 characters of `A-Z a-z 0-9 _ -`) and `cData` (1 to 255 characters of the same set) are optional and replace the page's `data-action` / `data-cdata`. The solution holds `token` (the `cf-turnstile-response` value) and `timing.solveMs`; Turnstile returns no `userAgent`.
|
|
190
|
+
|
|
191
|
+
```typescript
|
|
192
|
+
const solution = await client.solve({
|
|
193
|
+
type: TaskType.TURNSTILE_PROXYLESS,
|
|
194
|
+
websiteURL: 'https://example.com/login',
|
|
195
|
+
websiteKey: '0x4AAAAAAAxxxxxxxxxxxxxx',
|
|
196
|
+
}, 120);
|
|
197
|
+
const token = solution.token;
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
With your own proxy (`TurnstileTask` requires one): a single `http(s)` URL in the `proxy` field, no `socks`:
|
|
201
|
+
|
|
202
|
+
```typescript
|
|
203
|
+
const solution = await client.solve({
|
|
204
|
+
type: TaskType.TURNSTILE,
|
|
205
|
+
websiteURL: 'https://example.com/login',
|
|
206
|
+
websiteKey: '0x4AAAAAAAxxxxxxxxxxxxxx',
|
|
207
|
+
action: 'login',
|
|
208
|
+
cData: 'session-42',
|
|
209
|
+
proxy: 'http://user:pass@host:port',
|
|
210
|
+
}, 120);
|
|
211
|
+
```
|
|
212
|
+
|
|
187
213
|
### With Proxy
|
|
188
214
|
|
|
189
215
|
All task types support proxy configuration:
|
|
@@ -248,6 +274,8 @@ TaskType.RECAPTCHA_V3 // ReCaptchaV3Task
|
|
|
248
274
|
TaskType.RECAPTCHA_V3_PROXYLESS // ReCaptchaV3TaskProxyLess
|
|
249
275
|
TaskType.RECAPTCHA_V3_ENTERPRISE // ReCaptchaV3EnterpriseTask
|
|
250
276
|
TaskType.RECAPTCHA_V3_ENTERPRISE_PROXYLESS // ReCaptchaV3EnterpriseTaskProxyLess
|
|
277
|
+
TaskType.TURNSTILE // TurnstileTask
|
|
278
|
+
TaskType.TURNSTILE_PROXYLESS // TurnstileTaskProxyLess
|
|
251
279
|
```
|
|
252
280
|
|
|
253
281
|
## Documentation
|
|
@@ -273,6 +301,7 @@ See the [examples](examples/) directory for complete runnable examples:
|
|
|
273
301
|
- [recaptcha-v2.ts](examples/recaptcha-v2.ts) - reCAPTCHA v2 solving
|
|
274
302
|
- [recaptcha-v3.ts](examples/recaptcha-v3.ts) - reCAPTCHA v3 solving
|
|
275
303
|
- [aws-waf.ts](examples/aws-waf.ts) - AWS WAF challenge solving
|
|
304
|
+
- [turnstile.ts](examples/turnstile.ts) - Cloudflare Turnstile solving
|
|
276
305
|
|
|
277
306
|
### Advanced Examples
|
|
278
307
|
Full integration examples in the [documentation](https://github.com/CapBypass-Development/capbypass-sdks/tree/main/docs/examples):
|
package/dist/index.d.mts
CHANGED
|
@@ -16,6 +16,8 @@ declare const TaskType: {
|
|
|
16
16
|
readonly HCAPTCHA_PROXYLESS: "HCaptchaTaskProxyless";
|
|
17
17
|
readonly CAPTCHA_FOX: "CaptchaFoxTask";
|
|
18
18
|
readonly CAPTCHA_FOX_PROXYLESS: "CaptchaFoxTaskProxyLess";
|
|
19
|
+
readonly TURNSTILE: "TurnstileTask";
|
|
20
|
+
readonly TURNSTILE_PROXYLESS: "TurnstileTaskProxyLess";
|
|
19
21
|
};
|
|
20
22
|
type TaskTypeValue = typeof TaskType[keyof typeof TaskType];
|
|
21
23
|
/**
|
|
@@ -62,6 +64,7 @@ interface ClientOptions {
|
|
|
62
64
|
developerKey?: string;
|
|
63
65
|
}
|
|
64
66
|
|
|
67
|
+
declare const SDK_VERSION: string;
|
|
65
68
|
/**
|
|
66
69
|
* CapBypass API Client
|
|
67
70
|
*/
|
|
@@ -209,4 +212,4 @@ declare class ParseError extends Error {
|
|
|
209
212
|
constructor(message: string, cause?: Error | undefined);
|
|
210
213
|
}
|
|
211
214
|
|
|
212
|
-
export { AuthenticationError, type BaseTask, CapBypassClient, CapBypassError, type ClientOptions, GatewayError, InsufficientBalanceError, InternalError, NetworkError, ParseError, type PricingItem, type ProxyConfig, RateLimitError, ServerError, SolverError, TaskNotFoundError, type TaskResult, TaskType, type TaskTypeValue, TimeoutError, ValidationError };
|
|
215
|
+
export { AuthenticationError, type BaseTask, CapBypassClient, CapBypassError, type ClientOptions, GatewayError, InsufficientBalanceError, InternalError, NetworkError, ParseError, type PricingItem, type ProxyConfig, RateLimitError, SDK_VERSION, ServerError, SolverError, TaskNotFoundError, type TaskResult, TaskType, type TaskTypeValue, TimeoutError, ValidationError };
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ declare const TaskType: {
|
|
|
16
16
|
readonly HCAPTCHA_PROXYLESS: "HCaptchaTaskProxyless";
|
|
17
17
|
readonly CAPTCHA_FOX: "CaptchaFoxTask";
|
|
18
18
|
readonly CAPTCHA_FOX_PROXYLESS: "CaptchaFoxTaskProxyLess";
|
|
19
|
+
readonly TURNSTILE: "TurnstileTask";
|
|
20
|
+
readonly TURNSTILE_PROXYLESS: "TurnstileTaskProxyLess";
|
|
19
21
|
};
|
|
20
22
|
type TaskTypeValue = typeof TaskType[keyof typeof TaskType];
|
|
21
23
|
/**
|
|
@@ -62,6 +64,7 @@ interface ClientOptions {
|
|
|
62
64
|
developerKey?: string;
|
|
63
65
|
}
|
|
64
66
|
|
|
67
|
+
declare const SDK_VERSION: string;
|
|
65
68
|
/**
|
|
66
69
|
* CapBypass API Client
|
|
67
70
|
*/
|
|
@@ -209,4 +212,4 @@ declare class ParseError extends Error {
|
|
|
209
212
|
constructor(message: string, cause?: Error | undefined);
|
|
210
213
|
}
|
|
211
214
|
|
|
212
|
-
export { AuthenticationError, type BaseTask, CapBypassClient, CapBypassError, type ClientOptions, GatewayError, InsufficientBalanceError, InternalError, NetworkError, ParseError, type PricingItem, type ProxyConfig, RateLimitError, ServerError, SolverError, TaskNotFoundError, type TaskResult, TaskType, type TaskTypeValue, TimeoutError, ValidationError };
|
|
215
|
+
export { AuthenticationError, type BaseTask, CapBypassClient, CapBypassError, type ClientOptions, GatewayError, InsufficientBalanceError, InternalError, NetworkError, ParseError, type PricingItem, type ProxyConfig, RateLimitError, SDK_VERSION, ServerError, SolverError, TaskNotFoundError, type TaskResult, TaskType, type TaskTypeValue, TimeoutError, ValidationError };
|
package/dist/index.js
CHANGED
|
@@ -39,6 +39,7 @@ __export(index_exports, {
|
|
|
39
39
|
NetworkError: () => NetworkError,
|
|
40
40
|
ParseError: () => ParseError,
|
|
41
41
|
RateLimitError: () => RateLimitError,
|
|
42
|
+
SDK_VERSION: () => SDK_VERSION,
|
|
42
43
|
ServerError: () => ServerError,
|
|
43
44
|
SolverError: () => SolverError,
|
|
44
45
|
TaskNotFoundError: () => TaskNotFoundError,
|
|
@@ -166,7 +167,7 @@ function parseError(errorCode, errorDescription) {
|
|
|
166
167
|
|
|
167
168
|
// src/client.ts
|
|
168
169
|
var DEFAULT_BASE_URL = "https://api.capbypass.pro";
|
|
169
|
-
var SDK_VERSION = "1.0.
|
|
170
|
+
var SDK_VERSION = true ? "1.0.10" : "unknown";
|
|
170
171
|
var USER_AGENT = `capbypass-sdk-typescript/${SDK_VERSION}`;
|
|
171
172
|
var POLL_DELAYS_SECONDS = [1, 1, 1, 2, 2];
|
|
172
173
|
var MAX_POLL_DELAY_SECONDS = 3;
|
|
@@ -403,7 +404,10 @@ var TaskType = {
|
|
|
403
404
|
HCAPTCHA_PROXYLESS: "HCaptchaTaskProxyless",
|
|
404
405
|
// CaptchaFox
|
|
405
406
|
CAPTCHA_FOX: "CaptchaFoxTask",
|
|
406
|
-
CAPTCHA_FOX_PROXYLESS: "CaptchaFoxTaskProxyLess"
|
|
407
|
+
CAPTCHA_FOX_PROXYLESS: "CaptchaFoxTaskProxyLess",
|
|
408
|
+
// Cloudflare Turnstile
|
|
409
|
+
TURNSTILE: "TurnstileTask",
|
|
410
|
+
TURNSTILE_PROXYLESS: "TurnstileTaskProxyLess"
|
|
407
411
|
};
|
|
408
412
|
// Annotate the CommonJS export names for ESM import in node:
|
|
409
413
|
0 && (module.exports = {
|
|
@@ -416,6 +420,7 @@ var TaskType = {
|
|
|
416
420
|
NetworkError,
|
|
417
421
|
ParseError,
|
|
418
422
|
RateLimitError,
|
|
423
|
+
SDK_VERSION,
|
|
419
424
|
ServerError,
|
|
420
425
|
SolverError,
|
|
421
426
|
TaskNotFoundError,
|
package/dist/index.mjs
CHANGED
|
@@ -116,7 +116,7 @@ function parseError(errorCode, errorDescription) {
|
|
|
116
116
|
|
|
117
117
|
// src/client.ts
|
|
118
118
|
var DEFAULT_BASE_URL = "https://api.capbypass.pro";
|
|
119
|
-
var SDK_VERSION = "1.0.
|
|
119
|
+
var SDK_VERSION = true ? "1.0.10" : "unknown";
|
|
120
120
|
var USER_AGENT = `capbypass-sdk-typescript/${SDK_VERSION}`;
|
|
121
121
|
var POLL_DELAYS_SECONDS = [1, 1, 1, 2, 2];
|
|
122
122
|
var MAX_POLL_DELAY_SECONDS = 3;
|
|
@@ -353,7 +353,10 @@ var TaskType = {
|
|
|
353
353
|
HCAPTCHA_PROXYLESS: "HCaptchaTaskProxyless",
|
|
354
354
|
// CaptchaFox
|
|
355
355
|
CAPTCHA_FOX: "CaptchaFoxTask",
|
|
356
|
-
CAPTCHA_FOX_PROXYLESS: "CaptchaFoxTaskProxyLess"
|
|
356
|
+
CAPTCHA_FOX_PROXYLESS: "CaptchaFoxTaskProxyLess",
|
|
357
|
+
// Cloudflare Turnstile
|
|
358
|
+
TURNSTILE: "TurnstileTask",
|
|
359
|
+
TURNSTILE_PROXYLESS: "TurnstileTaskProxyLess"
|
|
357
360
|
};
|
|
358
361
|
export {
|
|
359
362
|
AuthenticationError,
|
|
@@ -365,6 +368,7 @@ export {
|
|
|
365
368
|
NetworkError,
|
|
366
369
|
ParseError,
|
|
367
370
|
RateLimitError,
|
|
371
|
+
SDK_VERSION,
|
|
368
372
|
ServerError,
|
|
369
373
|
SolverError,
|
|
370
374
|
TaskNotFoundError,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capbypass/sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "Official TypeScript/JavaScript SDK for CapBypass CAPTCHA solving service",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
|
-
"build": "tsup
|
|
19
|
+
"build": "tsup",
|
|
20
20
|
"test": "jest",
|
|
21
21
|
"test:watch": "jest --watch",
|
|
22
22
|
"test:coverage": "jest --coverage",
|