@ecurtiy/widget
v1.2.0
Published
ECURTIY - Privacy-first invisible captcha widget with advanced bot detection
Maintainers
Readme
@ecurtiy/widget
Privacy-first, invisible captcha widget for bot protection. ECURTIY protects your websites from bots using browser fingerprinting and behavioral analysis, showing challenges only when necessary.
Installation
npm install @ecurtiy/widgetOr include via CDN:
<script src="https://ecurtiy.com/v1/ecurity.min.js"></script>Quick Start
JavaScript/TypeScript
import { ECurtiy } from '@ecurtiy/widget';
// Initialize the widget
const ecurtiy = new ECurtiy({
siteKey: 'your-site-key',
onSuccess: (token) => {
console.log('Verification successful:', token);
// Send token to your server for validation
},
onError: (error) => {
console.error('Verification failed:', error);
},
});
// Render the widget in a container
ecurtiy.render('#captcha-container');Script Tag
<div id="captcha-container"></div>
<script src="https://ecurtiy.com/v1/ecurity.min.js"></script>
<script>
const ecurtiy = new window.ecurtiy.ECurtiy({
siteKey: 'your-site-key',
onSuccess: function(token) {
document.getElementById('ecurtiy-token').value = token;
}
});
ecurtiy.render('#captcha-container');
</script>Configuration Options
| Option | Type | Required | Description |
|--------|------|----------|-------------|
| siteKey | string | Yes | Your ECURTIY site key from the dashboard |
| onSuccess | (token: string) => void | Yes | Callback when verification succeeds |
| onError | (error: Error) => void | No | Callback when verification fails |
| onExpire | () => void | No | Callback when token expires |
| theme | 'light' \| 'dark' \| 'auto' | No | Widget theme (default: 'auto') |
| size | 'normal' \| 'compact' | No | Widget size (default: 'normal') |
| language | string | No | Language code (default: browser language) |
Methods
render(container: string | HTMLElement)
Renders the widget in the specified container.
ecurtiy.render('#my-container');
// or
ecurtiy.render(document.getElementById('my-container'));reset()
Resets the widget to its initial state.
ecurtiy.reset();remove()
Removes the widget from the DOM.
ecurtiy.remove();getResponse()
Returns the current verification token, or null if not verified.
const token = ecurtiy.getResponse();Server-Side Verification
After receiving the token on your server, verify it using the @ecurtiy/server package:
import { verifyToken } from '@ecurtiy/server';
const result = await verifyToken({
secretKey: 'your-secret-key',
token: tokenFromClient,
remoteip: clientIpAddress, // optional
});
if (result.success) {
// Token is valid
} else {
// Token is invalid
}React Integration
For React applications, use the @ecurtiy/react package:
npm install @ecurtiy/reactimport { ECurtiyCaptcha } from '@ecurtiy/react';
function MyForm() {
return (
<form>
<ECurtiyCaptcha
siteKey="your-site-key"
onVerify={(token) => console.log(token)}
/>
<button type="submit">Submit</button>
</form>
);
}How It Works
ECURTIY uses a multi-layered approach to bot detection:
- Invisible Mode (85% of traffic) - Pure fingerprint + behavioral analysis. Legitimate users pass automatically.
- Checkbox Mode (10% of traffic) - Simple click verification for medium-risk requests.
- Interactive Challenge (5% of traffic) - Slide puzzle for high-risk requests.
Browser Support
- Chrome 60+
- Firefox 55+
- Safari 12+
- Edge 79+
License
MIT
