-
Choose the version:
-
Stable: Use the stable version by including the following script tag:
<script src="https://ncaptcha.xyz/n-captcha/[email protected]"></script>
-
Latest: If you want to try out all the newest features, use the latest version by including the following script tag:
<script src="https://ncaptcha.xyz/n-captcha/[email protected]"></script>
-
-
Add the following element inside your form:
<div id="nCaptcha-verification" data-account="SITE_OWNER.near" data-price="0.02">
Replace
SITE_OWNER.near
with your NEAR wallet address. You can learn more about NEAR wallets here. Thedata-price
attribute represents the cost of passing the captcha. -
nCaptcha provides
window.nCaptchaWallet.nCaptcha.isValid
andwindow.nCaptchaWallet.nCaptcha.transaction
for checking and dynamically updating the captcha validation. You can refer to the basic implementation example in theexample
directory.
-
Add script to your package json from lnc-ncaptcha
-
Use npm install
-
Import initNCaptcha from package;
-
Add the following element inside your form:
-
Add the following element inside your form:
<div id="nCaptcha-verification" data-account="SITE_OWNER.near" data-price="0.02">
Replace
SITE_OWNER.near
with your NEAR wallet address. You can learn more about NEAR wallets here. Thedata-price
attribute represents the cost of passing the captcha. -
nCaptcha provides
window.nCaptchaWallet.nCaptcha.isValid
andwindow.nCaptchaWallet.nCaptcha.transaction
for checking and dynamically updating the captcha validation. You can refer to the basic implementation example in theexample
directory.
To run the example/example-npm:
- Download this repository and go to example dir
- Install dependencies by running
npm i
. - Build the example by running
npm run build
. - Start the example by running
npm start
.
The example will be accessible at http://localhost:1234.