This application integrates Friendly Captcha for form submissions using FastAPI. It verifies captcha responses and retrieves risk intelligence (if enabled on the application) from the same form flow.
- Python 3.10+
- Your Friendly Captcha API key and sitekey.
- Set up a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
pip install -r requirements.txt- Set environment variables and start the application
NOTE:
FRC_API_ENDPOINTandFRC_WIDGET_ENDPOINTare optional. If not set, default values are used. You can also useglobaloreuas shorthands for both. For the frontenddata-api-endpoint, use the base endpoint (for examplehttp://localhost:8182), not/api/v2/captcha.
FRC_APIKEY=<your API key> FRC_SITEKEY=<your sitekey> FRC_API_ENDPOINT=<api endpoint> FRC_WIDGET_ENDPOINT=<widget endpoint> uvicorn main:app --reload --port 8000Navigate to http://localhost:8000/ in your browser. Fill out the form and submit. The backend verifies the captcha and also retrieves risk intelligence data when a risk intelligence token is available.