@hcaptcha/vue-hcaptcha
Advanced tools
Comparing version 0.2.4 to 0.3.0-alpha1
{ | ||
"name": "@hcaptcha/vue-hcaptcha", | ||
"version": "0.2.4", | ||
"main": "./src/main.js", | ||
"version": "0.3.0-alpha1", | ||
"types": "types/index.d.ts", | ||
"main": "./dist/@hcaptcha/vue-hcaptcha.umd.min.js", | ||
"module": "./dist/@hcaptcha/vue-hcaptcha.common.js", | ||
"files": [ | ||
"dist/@hcaptcha", | ||
"types/index.d.ts" | ||
], | ||
"author": "hCaptcha team and contributors", | ||
@@ -18,9 +24,11 @@ "homepage": "https://github.com/hCaptcha/vue-hcaptcha", | ||
"scripts": { | ||
"test": "vue-cli-service test:unit", | ||
"test": "npm run test:unit && npm run test:types", | ||
"test:unit": "vue-cli-service test:unit", | ||
"test:types": "tsc -p types/__tests__", | ||
"lint": "vue-cli-service lint --no-fix", | ||
"lint:fix": "vue-cli-service lint", | ||
"serve": "vue-cli-service serve", | ||
"build": "vue-cli-service build" | ||
"build": "vue-cli-service build --target lib src/main.js" | ||
}, | ||
"devDependencies": { | ||
"@actions/core": "^1.2.6", | ||
"@babel/core": "^7.2.2", | ||
@@ -56,3 +64,5 @@ "@babel/plugin-transform-modules-commonjs": "^7.2.0", | ||
"mini-css-extract-plugin": "^0.4.2", | ||
"node-fetch": "^2.6.1", | ||
"thread-loader": "^1.2.0", | ||
"typescript": "^4.1.3", | ||
"vue": "^2.6.12", | ||
@@ -101,4 +111,12 @@ "vue-jest": "^3.0.2", | ||
"keywords": [ | ||
"hcaptcha", "captcha", "component", "vue", "vue-component", "earn" | ||
] | ||
"hcaptcha", | ||
"captcha", | ||
"component", | ||
"vue", | ||
"vue-component", | ||
"earn" | ||
], | ||
"peerDependencies": { | ||
"vue": "^2.0.0" | ||
} | ||
} |
@@ -11,7 +11,13 @@ # Vue.js hCaptcha Component Library | ||
or by including the library in a script tag | ||
or via yarn: | ||
``` | ||
<script src="../vue-hcaptcha.js"></script> | ||
yarn add @hcaptcha/vue-hcaptcha | ||
``` | ||
or via script tag (`Vue` must be globally available) | ||
``` | ||
<script src="https://unpkg.com/vue"></script> | ||
<script src="https://unpkg.com/@hcaptcha/vue-hcaptcha"></script> | ||
``` | ||
#### Basic Usage | ||
@@ -35,3 +41,2 @@ ``` | ||
**Note**: There's a known flaw when there are multiple captchas being rendered. It's recommended to use only one captcha per page. | ||
@@ -42,18 +47,41 @@ ### Api | ||
|Name|Values/Type|Required|Description| | ||
|---|---|---|:---:| | ||
|`sitekey`|String|**Yes**|This is your sitekey, this allows you to load captcha. If you need a sitekey, please visit [hCaptcha](https://www.hcaptcha.com), and sign up to get your sitekey.| | ||
|`size`|String (normal, compact, invisible)|No, default: normal|This specifies the "size" of the component. hCaptcha allows you to decide how big the component will appear on render, this always defaults to normal.| | ||
|`theme`|String (light, dark)|No, default: light|hCaptcha supports both a light and dark theme. If no theme is inherently set, the captcha will always default to light.| | ||
|`tabindex`|Integer|No, default: 0|Set the tabindex of the widget and popup. When appropriate, this can make navigation of your site more intuitive.| | ||
|`language`|String (ISO 639-2 code)|No, default: (auto)|hCaptcha auto-detects language via the user's browser. This overrides that to set a default UI language.| | ||
|Name|Values/Type|Required|Default|Description| | ||
|---|---|---|---|---| | ||
|`sitekey`|String|**Yes**|`-`|This is your sitekey, this allows you to load captcha. If you need a sitekey, please visit [hCaptcha](https://www.hcaptcha.com), and sign up to get your sitekey.| | ||
|`size`|String (normal, compact, invisible)|No|`normal`|This specifies the "size" of the component. hCaptcha allows you to decide how big the component will appear on render, this always defaults to normal.| | ||
|`theme`|String (light, dark)|No|`light`|hCaptcha supports both a light and dark theme. If no theme is inherently set, the captcha will always default to light.| | ||
|`tabindex`|Integer|No|`0`|Set the tabindex of the widget and popup. When appropriate, this can make navigation of your site more intuitive.| | ||
|`language`|String (ISO 639-2 code)|No|`auto`|hCaptcha auto-detects language via the user's browser. This overrides that to set a default UI language.| | ||
|`reCaptchaCompat`|Boolean|No|`true`|Disable drop-in replacement for reCAPTCHA with `false` to prevent hCaptcha from injecting into window.grecaptcha.| | ||
|`challengeContainer`|String|No|`-`|A custom element id to render the hCaptcha challenge.| | ||
|`rqdata`|String|No|-|See Enterprise docs.| | ||
|`sentry`|Boolean|No|-|See Enterprise docs.| | ||
|`apiEndpoint`|String|No|-|See Enterprise docs.| | ||
|`endpoint`|String|No|-|See Enterprise docs.| | ||
|`reportapi`|String|No|-|See Enterprise docs.| | ||
|`assethost`|String|No|-|See Enterprise docs.| | ||
|`imghost`|String|No|-|See Enterprise docs.| | ||
#### Events | ||
- `@verify="onVerify"` | ||
- `@expired="onExpired"` | ||
- `@error="onError"` (The captcha will automatically reset on error) | ||
- `@opened="onOpened"` | ||
- `@closed="onClosed"` | ||
|Event|Params|Description| | ||
|---|---|---| | ||
|`error`|`err`|When an error occurs. Component will reset immediately after an error.| | ||
|`verify`|`token, eKey`|When challenge is completed. The `token` and an `eKey` are passed along.| | ||
|`expired`|-|When the current token expires.| | ||
|`challengeExpired`|-|When the unfinished challenge expires.| | ||
|`opened`|-|When the challenge is opened.| | ||
|`closed`|-|When the challenge is opened.| | ||
|`reset`|-|When the challenge is reset.| | ||
|`rendered`|-|When the challenge is rendered.| | ||
|`executed`|-|When the challenge is executed.| | ||
### Methods | ||
|Method|Description| | ||
|---|---| | ||
|`execute()`|Programmatically trigger a challenge request| | ||
|`reset()`|Reset the current challenge| | ||
### FAQ | ||
@@ -60,0 +88,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
1173
120
0
135813
1
40
10
1