# @hcaptcha/types

> hCaptcha Type Definitions

Latest version **1.2.0** (published 2026-02-20) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2026-02-20 |
| First published | 2022-03-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | brdlyptrs, hcaptcha-npmjs |

## Links

- npm: https://www.npmjs.com/package/@hcaptcha/types
- npm.io page: https://npm.io/package/@hcaptcha/types

## Recent versions

- 1.2.0 (latest) — 2026-02-20
- 1.1.0 — 2025-10-02
- 1.0.4 — 2024-08-01
- 1.0.3 — 2022-10-12
- 1.0.2 — 2022-05-24
- 1.0.1 — 2022-04-04
- 1.0.0 — 2022-03-25

## README

## hCaptcha TypeScript Definitions

TypeScript module for `hcaptcha` global variable.


### Installation

```bash
yarn add -D @hcaptcha/types
```

or via npm

```bash
npm install -D @hcaptcha/types
```

### How to use

#### Locally in file

```ts
import '@hcaptcha/types';

// `hcaptcha` now is defined on the global object
hcaptcha.execute();
```

or

```ts
///<reference types="@hcaptcha/types"/>

// `hcaptcha` now is defined on the global object
hcaptcha.execute();
```

#### Globally

Add import or reference to your `.d.ts`:

```ts
import "@hcaptcha/types";

// or

/// <reference types="@hcaptcha/types"/>
```

Or add `"node_modules/@hcaptcha"` to the `typeRoots` in `tsconfig.json`

```json
{
  "compilerOptions": {
    // ...
    "typeRoots": [
      "node_modules/@hcaptcha"
    ]
    // ...
  },
  // ...
}
```

### Bug Report

If you encounter an issue and would like to report it, please email us at [support@hcaptcha.com](mailto:support@hcaptcha.com).

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