vue-recaptcha-v3
Advanced tools
Comparing version 1.1.1 to 1.2.0
@@ -0,3 +1,5 @@ | ||
import { IReCaptchaLoaderOptions } from 'recaptcha-v3/dist/ReCaptchaLoader'; | ||
export interface IReCaptchaOptions { | ||
siteKey: string; | ||
loaderOptions: IReCaptchaLoaderOptions; | ||
} |
@@ -47,3 +47,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
}); }; | ||
plugin.initializeReCaptcha(options.siteKey).then(function (wrapper) { | ||
plugin.initializeReCaptcha(options).then(function (wrapper) { | ||
recaptchaLoaded = true; | ||
@@ -59,7 +59,7 @@ Vue.prototype.$recaptcha = function (action) { | ||
} | ||
ReCaptchaVuePlugin.prototype.initializeReCaptcha = function (siteKey) { | ||
ReCaptchaVuePlugin.prototype.initializeReCaptcha = function (options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4, loadReCaptcha(siteKey)]; | ||
case 0: return [4, loadReCaptcha(options.siteKey, options.loaderOptions)]; | ||
case 1: return [2, _a.sent()]; | ||
@@ -66,0 +66,0 @@ } |
{ | ||
"name": "vue-recaptcha-v3", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"keywords": [ | ||
@@ -32,3 +32,3 @@ "captcha", | ||
"dependencies": { | ||
"recaptcha-v3": "^1.0.2" | ||
"recaptcha-v3": "1.2.0" | ||
}, | ||
@@ -35,0 +35,0 @@ "devDependencies": { |
@@ -27,3 +27,4 @@ # Vue reCAPTCHA-v3 | ||
vue.use(VueReCaptcha, { siteKey: '<site key>' }) | ||
// For more options see below | ||
Vue.use(VueReCaptcha, { siteKey: '<site key>' }) | ||
@@ -40,3 +41,26 @@ new Vue({ | ||
}) | ||
``` | ||
## Options | ||
This plugin offers optional options to configure the behavior of some parts. | ||
Available options: | ||
|Name|Description|Type|Default value | ||
|----|-----------|----|------------- | ||
|siteKey|The site key for your domain from Google.|*string*|*none* | ||
|loaderOptions|Optional options for the [recaptcha-v3](https://github.com/AurityLab/recaptcha-v3) loader. The available options are described [here](https://github.com/AurityLab/recaptcha-v3/tree/v1.2.0#usage-1).|*object*|`null` | ||
### Usage | ||
To use the options just pass an object to the `Vue.use(...)` method. For example: | ||
```javascript | ||
import Vue from 'vue' | ||
import { VueReCaptcha } from 'vue-recaptcha-v3' | ||
Vue.use(VueReCaptcha, { | ||
siteKey: '<site key>', | ||
loaderOptions: { | ||
useRecaptchaNet: true | ||
} | ||
}) | ||
``` |
18383
83
65
+ Addedrecaptcha-v3@1.2.0(transitive)
- Removedrecaptcha-v3@1.10.0(transitive)
Updatedrecaptcha-v3@1.2.0