The widget comes with many defaults, and very configurable at the same time. The minimum configuration in production can be found below.
<cap-widget id="cap" data-cap-jwt-token=<<jwt_token>></cap-widget>Where <<jwt_token>> is replaced with the JWT generated on your server after receiving the nonce form the API.
The full list of options that can be added to the Captcha widget are listed below.
| Option | Description | Default |
| data-cap-api-endpoint | The API end point to use for challenges and solutions. | https://captcha.app47.com/ |
| data-cap-css-url | The CSS to load for the Captcha Widget | https://captcha-dist.app47.com/widget.min.css |
| data-cap-token-field-name | Name of the hidden field to store the catch token. If not found, it will be added to the form. When the form is submitted, the form post field name will be "cap-token". | cap-token |
| data-cap-nonce-field-name | Name of the hidden field to store the catch token. If not found, it will be added to the form. When the form is submitted, the form post field name will be "cap-nonce". | cap-nonce |
| data-cap-worker-count | Number of workers, or threads to start in the browser to solve the challneges. | 10 |
An example of the captcha widget with overrides for staging environment and change the name of the hidden fields.
<cap-widget id="cap"
data-cap-jwt-token=<<jwt_token>>
data-cap-css-url="https://captcha-dist.app47.net/widget.min.css"
data-cap-token-field-name="cap_token"
data-cap-nonce-field-name="cap_nonce"
data-cap-cap-worker-count=5
</cap-widget>Internalization
The widget can be internalization with your own text by adding additional parameters to the widget.
The full list of keywords that can be localized to the Captcha widget are listed below.
| Option | Description | Default |
| verifying-label | Text label when the captcha widget is verifying the solution. | Verifying... |
| initial-state | When the captcha widget is initialized | I'm a human |
| solved-label | When the solution is solved and accepted | You're a human |
| error-label | When an error occurs | Error. Try again. |
An example of the captcha widget with overrides for staging environment and change the name of the hidden fields.
<cap-widget id="cap"
data-cap-i18n-verifying-label="正在验证…"
data-cap-i18n-initial-state="我是人类"
data-cap-i18n-solved-label="你是人类"
data-cap-i18n-error-label="出错了,请重试。"
</cap-widget>
Comments
0 comments
Please sign in to leave a comment.