# @types/recaptcha2

> TypeScript definitions for recaptcha2

Latest version **1.3.4** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/recaptcha2
pnpm add @types/recaptcha2
yarn add @types/recaptcha2
bun add @types/recaptcha2
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.3.4 |
| Published | 2023-11-07 |
| First published | 2018-05-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51438 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/recaptcha2
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/recaptcha2
- npm.io page: https://npm.io/package/@types/recaptcha2

## Recent versions

- 1.3.4 (latest) — 2023-11-07
- 1.3.1 (ts3.6) — 2021-07-08
- 1.3.0 (ts2.2) — 2018-05-09
- 1.3.3 — 2023-10-18
- 1.3.2 — 2023-09-27

## README

# Installation
> `npm install --save @types/recaptcha2`

# Summary
This package contains type definitions for recaptcha2 (https://github.com/fereidani/recaptcha2#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/recaptcha2.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/recaptcha2/index.d.ts)
````ts
export = Recaptcha2;

declare class Recaptcha2 {
    constructor(options: Recaptcha2.Options);

    getRequestOptions<T extends object>(body: T): Recaptcha2.RequestOptions<T>;
    validate(token: string): Promise<void>;
    validateRequest(req: object, ip: string): Promise<void>;
    translateErrors(errorCodes: string): string;
    translateErrors(errorCodes: string[]): string[];
    formElement(htmlClass: string): string;
}

declare namespace Recaptcha2 {
    interface Options {
        siteKey: string;
        secretKey: string;
        ssl?: boolean | undefined;
    }

    interface RequestOptions<T> {
        uri: string;
        method: "POST";
        json: true;
        form: T;
    }
}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: none

# Credits
These definitions were written by [Jonas Lochmann](https://github.com/l-jonas).

---
_Source: https://npm.io/package/@types/recaptcha2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
