Use and test hCaptcha on localhost

9.3k views Asked by At

How can I test hCaptcha on localhost?

When using the key, I get a CORS error, and for choosing sites for the key, it specifically states ... localhost will not work

2

There are 2 answers

2
Kevin Danikowski On BEST ANSWER

There are test keys you should use for testing, see https://docs.hcaptcha.com/#integration-testing-test-keys

Referenced Below:

Test Key Set: Publisher Account

Test parameter Value

Site Key 10000000-ffff-ffff-ffff-000000000001 Secret Key 0x0000000000000000000000000000000000000000

Test Key Set: Enterprise Account (Safe End User)

Test parameter Value

Site Key 20000000-ffff-ffff-ffff-000000000002 Secret Key 0x0000000000000000000000000000000000000000

Test Key Set: Enterprise Account (Bot Detected)

Test parameter Value

Site Key 30000000-ffff-ffff-ffff-000000000003 Secret Key 0x0000000000000000000000000000000000000000

PS: I confirmed this with the hCaptcha team.

PSS: A different work around would be use change your hosts file to point your-website.com to localhost to do testing.

0
Nefise Özşahin On

in the browser replace localhost to 127.0.0.1

https://i.stack.imgur.com/tDsPW.png