@vycecap/core
v1.0.1
Published
Vyce Captcha core library - Proof-of-Work and AI bot protection
Maintainers
Readme
@vycecap/core
Vyce Captcha core library - Privacy-first invisible CAPTCHA using Proof-of-Work and AI.
Installation
npm install @vycecap/coreUsage
Basic
<div id="vyce-captcha"></div>
<script type="module">
import { initVyceCaptcha } from '@vycecap/core';
import '@vycecap/core/style.css';
const vyce = initVyceCaptcha('vyce-captcha', {
sitekey: 'your-site-key',
mode: 'checkbox',
onVerify: (token) => {
console.log('Verified!', token);
}
});
</script>Auto Mode
const vyce = initVyceCaptcha('vyce-captcha', {
sitekey: 'your-site-key',
mode: 'auto', // Automatically verifies on load
onVerify: (token) => submitForm(token)
});Invisible Mode
const vyce = initVyceCaptcha('vyce-captcha', {
sitekey: 'your-site-key',
mode: 'invisible'
});
// Trigger verification programmatically
document.getElementById('submit-btn').addEventListener('click', async () => {
const token = await vyce.execute();
submitForm(token);
});API
initVyceCaptcha(elementId, options)
Initialize Vyce Captcha on a container element.
Options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| sitekey | string | required | Your site key from Vyce dashboard |
| mode | 'checkbox' \| 'auto' \| 'invisible' | 'checkbox' | Widget display mode |
| lang | string | 'en' | Language code |
| onVerify | (token: string) => void | - | Called on successful verification |
| onError | (error: string) => void | - | Called on verification failure |
| onExpire | () => void | - | Called when token expires |
Instance Methods
| Method | Returns | Description |
|--------|---------|-------------|
| getToken() | string \| null | Get current verification token |
| reset() | void | Reset widget to initial state |
| execute() | Promise<string> | Manually trigger verification |
| destroy() | void | Remove widget and cleanup |
Supported Languages
en- Englishde- Deutsches- Españolfr- Françaispt- Portuguêsit- Italianonl- Nederlandspl- Polskiru- Русскийzh- 中文ja- 日本語
License
MIT © Vyce Captcha
