Skip to content

Commit

Permalink
fix: add default export
Browse files Browse the repository at this point in the history
update README.md
  • Loading branch information
nextcaptcha committed Apr 8, 2024
1 parent 78ecd69 commit c623b0c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ To start using the NextCaptcha Node.js SDK, you first need to obtain your API ke
you can create a NextCaptcha instance:

```typescript
import {NextCaptcha} from 'nextcaptcha';
import NextCaptcha from 'nextcaptcha-ts';

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

```typescript
const result = await nextCaptcha.recaptchaV2(websiteURL, websiteKey);
const result = await nextCaptcha.recaptchaV2({websiteURL, websiteKey});
```

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

```typescript
const result = await nextCaptcha.recaptchaV3(websiteURL, websiteKey, pageAction);
const result = await nextCaptcha.recaptchaV3({websiteURL, websiteKey, pageAction});
```

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

```typescript
const result = await nextCaptcha.recaptchaMobile(websiteURL, websiteKey);
const result = await nextCaptcha.recaptchaMobile({websiteURL, websiteKey});
```

Solving hCaptcha
To solve hCaptcha challenges, use the hcaptcha method:

```typescript
const result = await nextCaptcha.hcaptcha(websiteURL, websiteKey);
const result = await nextCaptcha.hcaptcha({websiteURL, websiteKey});
```

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

```
const result = await nextCaptcha.hcaptchaEnterprise(websiteURL, websiteKey, enterprisePayload);
```typescript
const result = await nextCaptcha.hcaptchaEnterprise({websiteURL, websiteKey, enterprisePayload});
```

Solving FunCaptcha
To solve FunCaptcha challenges, use the funcaptcha method:

```
const result = await nextCaptcha.funcaptcha(websitePublicKey);
```typescript
const result = await nextCaptcha.funcaptcha({websitePublicKey, websiteURL});
```

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

```
```typescript
const balance = await nextCaptcha.getBalance();
console.log(`Account balance: ${balance}`);
```
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nextcaptcha-ts",
"version": "1.0.2",
"version": "1.0.3",
"description": "NextCaptcha Captcha Solving Service Api Wrapper for Typescript to solving recaptcha v2, v3,recapthcha moible,hcaptcha,funcaptcha",
"main": "dist/src/index.js",
"repository": {
Expand Down
8 changes: 1 addition & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {IFunCaptchaTask, IHCaptchaTask, IRecaptchaMobileTask, IReCaptchaV2Task,

// Define constants representing different types of captcha tasks
const RECAPTCHAV2_TYPE = "RecaptchaV2TaskProxyless";
const RECAPTCHAV2_ENTERPRISE_TYPE = "RecaptchaV2EnterpriseTaskProxyless";
const RECAPTCHAV3_PROXYLESS_TYPE = "RecaptchaV3TaskProxyless";
const RECAPTCHAV3_TYPE = "RecaptchaV3Task";
const RECAPTCHA_MOBILE_TYPE = "RecaptchaMobileTaskProxyless";
Expand All @@ -17,14 +16,9 @@ const FUNCAPTCHA_PROXYLESS_TYPE = "FunCaptchaTaskProxyless";
const TIMEOUT = 45;

// Define constants representing different task statuses
const PENDING_STATUS = "pending";
const PROCESSING_STATUS = "processing";
const READY_STATUS = "ready";
const FAILED_STATUS = "failed";

// Define a custom error class
class TaskBadParametersError extends Error {
}

// Define the ApiClient class for communicating with the NextCaptcha API
class ApiClient {
Expand Down Expand Up @@ -85,7 +79,7 @@ class ApiClient {
}

// Define the NextCaptcha class for interacting with the NextCaptcha service
export class NextCaptcha {
export default class NextCaptcha {
private api: ApiClient;

constructor(apiKey: string) {
Expand Down
2 changes: 1 addition & 1 deletion test/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {describe, expect, test} from '@jest/globals';
import {NextCaptcha} from '../src'
import NextCaptcha from '../src'

require('dotenv').config();

Expand Down

0 comments on commit c623b0c

Please sign in to comment.