đ¤Captcha Verification
Learn how to integrate Captcha functionality into your Farcaster Frames using the Airstack Frog Recipes.
Step 1: Create Captcha Frames
First, create two new Frames for integrating the captcha:
/generate-captcha
: This Frame will be the 1st entry in the captcha flow to initially generate the captcha challenge that is unique to the user./verify-captcha
: This Frame will be the next entry after generating the captcha. In this Frame, the user's answer for the captcha challenge will be validated.
Additionally, add two new fields captchaId
and valueHash
in the initial state of the Frame that you will be used for the captcha verification.
Step 2: Generate Captcha Challenge
Then, generate a captcha challenge using the generatedCaptchaChallenge
function in the /generate-captcha
Frame.
The function will help you randomly generate two integers for your users, which they will need to provide the correct sum result for verification.
In addition to the two integers, a template Frame image will be given along with the hashed sum results in the state
field. The state
field should be stored in the Frame state.
In the Frame, it will also render a text input for user to input the captcha answer and a Verify
button to go to the next Frame /verify-captcha
for captcha validation.
Step 3: Verify Captcha Challenge
Once the user clicked on the Verify
button, they will be redirected to the /verify-captcha
Frame where validateCaptchaChallenge
function will be called to validate the user's captcha answer with the Frame state (generated from generateCaptchaChallenge
).
If the validation is successful, isValidated
field will return true
. Otherwise, false
.
Similarly, you can use the image
field for the Farcaster Frame image, which will provide you a template verification image from Airstack.
đĨŗ Congratulations, you've just integrated Captcha into your Farcaster Frames using Airstack Frog Recipes!
Developer Support
If you have any questions or need help integrating Captcha into your Farcaster Frames using the Airstack Frog Recipe, please join our Airstack's Telegram group.
More Resources
Last updated