# hcaptcha-nuxt

> hCaptcha integration with Nuxt.js

Latest version **1.0.1** (published 2021-03-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install hcaptcha-nuxt
pnpm add hcaptcha-nuxt
yarn add hcaptcha-nuxt
bun add hcaptcha-nuxt
```

## Health

**Score 25/100 (F)** — status: abandoned.

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2021-03-12 |
| First published | 2021-03-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Kento Oki |
| Maintainers | kkent030315 |
| Keywords | captcha, hcaptcha, nuxt, nuxtjs |

## Links

- npm: https://www.npmjs.com/package/hcaptcha-nuxt
- Repository: https://github.com/kkent030315/hcaptcha-module
- Homepage: https://github.com/kkent030315/hcaptcha-module#readme
- Issues: https://github.com/kkent030315/hcaptcha-module/issues
- npm.io page: https://npm.io/package/hcaptcha-nuxt

## Recent versions

- 1.0.1 (latest) — 2021-03-12
- 1.0.0 — 2021-03-12

## README

<p align="center">
    <img alt="License" src="https://img.shields.io/github/license/kkent030315/hcaptcha-module?style=for-the-badge" />
    <img alt="CircleCI" src="https://img.shields.io/circleci/build/github/kkent030315/hcaptcha-module?style=for-the-badge">
    <img alt="npm" src="https://img.shields.io/npm/v/hcaptcha-nuxt?style=for-the-badge">
    <img alt="npm bundle size" src="https://img.shields.io/bundlephobia/min/hcaptcha-nuxt?style=for-the-badge">
</p>

# hcaptcha-module
hCaptcha integration with Nuxt.js

# Usage

1. Install

```bash
npm i hcaptcha-nuxt
```

or using `yarn`

```bash
yarn add hcaptcha-nuxt
```

2. Add `hcaptcha-nuxt` module in `nuxt.config.js`

```js
export default {
    modules: [
        "hcaptcha-nuxt"
    ],
}
```

3. Specify your site key in `nuxt.config.js`

```js
export default {
    hcaptcha: {
        siteKey: process.env.HCAPTCHA_SITE_KEY || ''
    }
}
```

4. Add `<hcaptcha>` component in `your-component.vue`

```html
<template>
    <div>
        <hcaptcha />
    </div>
</template>
```

5. You are ready to go. get the response and send it to the server then validate it

In `your-component.vue`

```html
<script>
export default {
    methods: {
        onSubmit() {
            const hcaptcha_response = this.$hcaptcha.getResponse()
        }
    }
}
</script>
```

# Local Development

For local development, as modern browsers have strict CORS CORB,  
hCaptcha will not work on `file://somewhere` either `localhost`

add `127.0.0.1 your.domain.com` to the `hosts` to prevent this.

- `/etc/hosts` on Linux,
- `/private/hosts` on OSX,
- `%SystemRoot%/System32/drivers/etc/hosts` on Windows.

# License

MIT

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