please have a look at Flask-Recaptcha which also support V3 from Google: https://github.com/rlid/flask-recaptcha
You can create Recaptcha fields like this:
class Recaptcha3Form(FlaskForm):
message = TextField(label="Message")
recaptcha = Recaptcha3Field(action="TestAction", execute_on_load=True)
submit = SubmitField(label="Submit")
and render it like this:
@app.route("/v3", methods=["GET", "POST"])
def v3():
form = Recaptcha3Form()
if form.validate_on_submit():
form.message.data = "[Success]" + form.message.data
return render_template("demo.html", form=form)
Please note: I copied the code from the from flask recaptcha documentation