Skip to content

Commit c623b0c

Browse files
author
nextcaptcha
committed
fix: add default export
update README.md
1 parent 78ecd69 commit c623b0c

File tree

4 files changed

+13
-19
lines changed

4 files changed

+13
-19
lines changed

Diff for: README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ To start using the NextCaptcha Node.js SDK, you first need to obtain your API ke
2121
you can create a NextCaptcha instance:
2222

2323
```typescript
24-
import {NextCaptcha} from 'nextcaptcha';
24+
import NextCaptcha from 'nextcaptcha-ts';
2525

2626
const apiKey = 'YOUR_API_KEY';
2727
const nextCaptcha = new NextCaptcha(apiKey);
@@ -32,48 +32,48 @@ Solving reCAPTCHA v2
3232
To solve reCAPTCHA v2 challenges, use the recaptchaV2 method:
3333

3434
```typescript
35-
const result = await nextCaptcha.recaptchaV2(websiteURL, websiteKey);
35+
const result = await nextCaptcha.recaptchaV2({websiteURL, websiteKey});
3636
```
3737

3838
Solving reCAPTCHA v3
3939
To solve reCAPTCHA v3 challenges, use the recaptchaV3 method:
4040

4141
```typescript
42-
const result = await nextCaptcha.recaptchaV3(websiteURL, websiteKey, pageAction);
42+
const result = await nextCaptcha.recaptchaV3({websiteURL, websiteKey, pageAction});
4343
```
4444

4545
Solving reCAPTCHA Mobile
4646
To solve reCAPTCHA Mobile challenges, use the recaptchaMobile method:
4747

4848
```typescript
49-
const result = await nextCaptcha.recaptchaMobile(websiteURL, websiteKey);
49+
const result = await nextCaptcha.recaptchaMobile({websiteURL, websiteKey});
5050
```
5151

5252
Solving hCaptcha
5353
To solve hCaptcha challenges, use the hcaptcha method:
5454

5555
```typescript
56-
const result = await nextCaptcha.hcaptcha(websiteURL, websiteKey);
56+
const result = await nextCaptcha.hcaptcha({websiteURL, websiteKey});
5757
```
5858

5959
Solving hCaptcha Enterprise
6060
To solve hCaptcha Enterprise challenges, use the hcaptchaEnterprise method:
6161

62-
```
63-
const result = await nextCaptcha.hcaptchaEnterprise(websiteURL, websiteKey, enterprisePayload);
62+
```typescript
63+
const result = await nextCaptcha.hcaptchaEnterprise({websiteURL, websiteKey, enterprisePayload});
6464
```
6565

6666
Solving FunCaptcha
6767
To solve FunCaptcha challenges, use the funcaptcha method:
6868

69-
```
70-
const result = await nextCaptcha.funcaptcha(websitePublicKey);
69+
```typescript
70+
const result = await nextCaptcha.funcaptcha({websitePublicKey, websiteURL});
7171
```
7272

7373
Checking Account Balance
7474
To check your NextCaptcha account balance, use the getBalance method:
7575

76-
```
76+
```typescript
7777
const balance = await nextCaptcha.getBalance();
7878
console.log(`Account balance: ${balance}`);
7979
```

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nextcaptcha-ts",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "NextCaptcha Captcha Solving Service Api Wrapper for Typescript to solving recaptcha v2, v3,recapthcha moible,hcaptcha,funcaptcha",
55
"main": "dist/src/index.js",
66
"repository": {

Diff for: src/index.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {IFunCaptchaTask, IHCaptchaTask, IRecaptchaMobileTask, IReCaptchaV2Task,
33

44
// Define constants representing different types of captcha tasks
55
const RECAPTCHAV2_TYPE = "RecaptchaV2TaskProxyless";
6-
const RECAPTCHAV2_ENTERPRISE_TYPE = "RecaptchaV2EnterpriseTaskProxyless";
76
const RECAPTCHAV3_PROXYLESS_TYPE = "RecaptchaV3TaskProxyless";
87
const RECAPTCHAV3_TYPE = "RecaptchaV3Task";
98
const RECAPTCHA_MOBILE_TYPE = "RecaptchaMobileTaskProxyless";
@@ -17,14 +16,9 @@ const FUNCAPTCHA_PROXYLESS_TYPE = "FunCaptchaTaskProxyless";
1716
const TIMEOUT = 45;
1817

1918
// Define constants representing different task statuses
20-
const PENDING_STATUS = "pending";
21-
const PROCESSING_STATUS = "processing";
2219
const READY_STATUS = "ready";
2320
const FAILED_STATUS = "failed";
2421

25-
// Define a custom error class
26-
class TaskBadParametersError extends Error {
27-
}
2822

2923
// Define the ApiClient class for communicating with the NextCaptcha API
3024
class ApiClient {
@@ -85,7 +79,7 @@ class ApiClient {
8579
}
8680

8781
// Define the NextCaptcha class for interacting with the NextCaptcha service
88-
export class NextCaptcha {
82+
export default class NextCaptcha {
8983
private api: ApiClient;
9084

9185
constructor(apiKey: string) {

Diff for: test/index.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {describe, expect, test} from '@jest/globals';
2-
import {NextCaptcha} from '../src'
2+
import NextCaptcha from '../src'
33

44
require('dotenv').config();
55

0 commit comments

Comments
 (0)