Overview of powCAPTCHA
powCAPTCHA is a privacy-first CAPTCHA solution that uses Proof-of-Work (PoW) to prevent bot activity and filter spam. It is designed for easy integration into websites to stop automated abuse while remaining user-friendly.
website·Indexed 31 days ago
https://docs.powcaptcha.comDocumentation for integrating and configuring the powCAPTCHA widget, including installation, server-side response verification, widget attributes, event listening, and invisible mode. Includes details on the machine learning-based spam filter available for Pro subscriptions.
Since the invisible widget does not have a visible trigger, you must decide when to obtain and solve the challenge. Common strategies include:
keyup event (or a specific number of keyups).<form method="POST" id="form-docs-example">
<input type="text" name="name" placeholder="Full name" required />
<input type="email" name="email" placeholder="Email" required />
<textarea name="message" placeholder="Message" required></textarea>
<powcaptcha-widget data-app-id="YOUR_APP_ID" data-invisible></powcaptcha-widget>
<input type="submit" value="Submit" />
</form>powcaptcha-widget element to respond to these events. The event data (such as tokens, error messages, or progress percentages) is contained within the event.detail object.const widget = document.querySelector('powcaptcha-widget');
// Handle successful completion
widget.addEventListener('@powcaptcha/widget/solved', (event) => {
console.log('Challenge solved:', event.detail.token);
});
// Handle errors
widget.addEventListener('@powcaptcha/widget/error', (event) => {
console.error('Error occurred:', event.detail.error);
});
// Handle start of solving process
widget.addEventListener('@powcaptcha/widget/solving', () => {
console.log('Solving challenge...');
});
// Handle solving progress updates
widget.addEventListener('@powcaptcha/widget/solving/progress', (event) => {
console.log('Solving progress:', event.detail.progress);
});<head> section of your HTML or immediately before the closing </body> tag. Use the async and defer attributes to ensure the script does not block page rendering.<script src="https://js.powcaptcha.com/widget.js" async defer></script>spamFilter object in the verification request sent to the /challenges/verify endpoint. The spamFilter object accepts optional email and text fields containing the user's form input for analysis.const response = await fetch('https://api.powcaptcha.com/challenges/verify', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
secret: 'your_private_key',
solution: 'your_solution_token',
spamFilter: {
email: requestUser.email,
text: requestUser.text,
},
}),
});data-invisible attribute to the <powcaptcha-widget> element. When using invisible mode, it is recommended to delay obtaining the challenge until after the page has loaded to ensure user signals are collected, which improves the accuracy of the challenge rating.<powcaptcha-widget data-app-id="YOUR_APP_ID" data-invisible="true"></powcaptcha-widget>data- attributes and the name attribute to the widget element. These control localization, themes, visibility, and server-side communication.<div
data-app-id="YOUR_APP_ID"
data-locale="en"
data-theme="dark"
data-invisible="true"
name="custom-captcha-response"
></div>The following events are emitted by the powCAPTCHA widget:
@powcaptcha/widget/solved: Fired when the challenge is successfully solved. The event.detail contains the solution token.@powcaptcha/widget/error: Fired when an error occurs during the challenge process. The event.detail contains error details.@powcaptcha/widget/solving: Fired when the challenge solving process starts. No additional detail is provided.@powcaptcha/widget/solving/progress: Fired to indicate progress while solving the challenge. The event.detail contains a progress value.<powcaptcha-widget> custom element. You must provide your unique application ID via the data-app-id attribute, which is available in the powCAPTCHA dashboard.<powcaptcha-widget data-app-id="YOUR_APP_ID"></powcaptcha-widget>POST /challenges/verify HTTP/1.1
Host: api.powcaptcha.com
Content-Type: application/json
{
"solution": "your_solution_token",
"secret": "your_private_key",
"spamFilter": {
"text": "optional_text_to_check_for_spam",
"email": "optional_email_to_check_for_spam"
}
}The powCAPTCHA verification request body accepts the following parameters:
solution (string, Required): The solution token received from the powCAPTCHA widget on the frontend.secret (string, Required): Your application’s private key. This must be kept secret and never exposed on the frontend.spamFilter (object, Optional): Used for advanced filtering (requires a paid plan). Contains:text (string, Optional): Text content to check for spam.email (string, Optional): Email address to check for spam.