hCaptcha Type Definitions
npm install @hcaptcha/typesTypeScript module for hcaptcha global variable.
``bash`
yarn add -D @hcaptcha/types
or via npm
`bash`
npm install -D @hcaptcha/types
#### Locally in file
`ts
import '@hcaptcha/types';
// hcaptcha now is defined on the global object`
hcaptcha.execute();
or
`ts
///
// hcaptcha now is defined on the global object`
hcaptcha.execute();
#### Globally
Add import or reference to your .d.ts:
`ts
import "@hcaptcha/types";
// or
///
`
Or add "node_modules/@hcaptcha" to the typeRoots in tsconfig.json
`json``
{
"compilerOptions": {
// ...
"typeRoots": [
"node_modules/@hcaptcha"
]
// ...
},
// ...
}
If you encounter an issue and would like to report it, please email us at support@hcaptcha.com.