FriendlyCaptcha / friendly-challenge

The widget and docs for the proof of work challenge used in Friendly Captcha. Protect your websites and online services from spam and abuse with Friendly Captcha, a privacy-first anti-bot solution.
https://friendlycaptcha.com
MIT License
412 stars 59 forks source link

Predefined theme based on data-theme #261

Closed tn3w closed 3 months ago

tn3w commented 3 months ago

Is there a way to implement that the page can preset the theme of the widget with data-theme like this:

<div class="frc-captcha" data-sitekey="<SITEKEY>" data-theme="<dark/light>">

Google reCaptcha, hCaptcha and Cloudflare Turnstile also use data-theme for this purpose. By the way: Why is data-lang not data-language like all others on the market and why is the solution in the token frc-captcha-solution not frc-captcha-response like the competitors e.g. Google reCaptcha: g-recaptcha-response or hCaptcha: h-captcha-response?

gzuidhof commented 3 months ago

Hi @tn3w,

We do support theming, we use a plain CSS class for it, see the docs here. The tl;dr is class="frc-captcha dark".

For the other changes: you're right that it's a bit different from other captcha providers. We are rolling out version two, and there it's a lot more similar (frc-captcha-response, data-theme=dark, and automatically doing language detection). The docs for that are found here. If you want we can provide you with an invite to the beta preview - we don't recommend it yet for critical production usecases.

tn3w commented 3 months ago

OK. Thanks a lot, it seems to work now.