{"id":16884320,"url":"https://github.com/simolus3/f_grecaptcha","last_synced_at":"2025-04-11T12:24:10.497Z","repository":{"id":55608177,"uuid":"121245755","full_name":"simolus3/f_grecaptcha","owner":"simolus3","description":"Flutter plugin exposing the SafetyNet reCAPTCHA API for Android to flutter apps. ","archived":false,"fork":false,"pushed_at":"2020-12-18T11:51:15.000Z","size":115,"stargazers_count":8,"open_issues_count":1,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T08:42:47.096Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simolus3.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-12T12:46:36.000Z","updated_at":"2022-03-22T09:50:47.000Z","dependencies_parsed_at":"2022-08-15T04:20:19.881Z","dependency_job_id":null,"html_url":"https://github.com/simolus3/f_grecaptcha","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simolus3%2Ff_grecaptcha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simolus3%2Ff_grecaptcha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simolus3%2Ff_grecaptcha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simolus3%2Ff_grecaptcha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simolus3","download_url":"https://codeload.github.com/simolus3/f_grecaptcha/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248401434,"owners_count":21097328,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T16:17:18.158Z","updated_at":"2025-04-11T12:24:10.474Z","avatar_url":"https://github.com/simolus3.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# f_grecaptcha\n\nThis simple [flutter](http://flutter.io/) plugin allows using the \n[SafetyNet API](https://developer.android.com/training/safetynet/recaptcha.html)\non Android devices to verify that the user is human.\n\n## Using the plugin\n### Preparations\n\nFirst, include the plugin in your project's dependencies by including it in\nthe relevant section of your `pubspec.yaml`:\n```yaml\ndependencies:\n  f_grecaptcha: ^1.0.0\n```\nNext, you wil need to register your app in the reCAPTCHA admin console. Go\nto https://www.google.com/recaptcha/admin#list and register by filling out\nthe form. Be sure to select \"reCAPTCHA-Android\" as the type. A form field\nasking for your Android package name will appear. You can copy it from the\nmanifest file located under `android/app/src/main/AndroidManifest.xml` in\nyour project directory. It is the value of the `package` attribute of the\nroot XML-tag. You can also visit the [instructions](https://developer.android.com/training/safetynet/recaptcha.html#register)\npage from the android documentation for a more detailed guide, only the\nsection \"Adding a SafetyNet API dependency\" is relevant, the plugin will do\nthe rest.\n\n### Verifying users\n\nAfter having your app registered with the reCAPTCHA API, you can invoke the\nfollowing method anywhere in your dart code, most commonly after a button\nhas been pressed. Replace `SITE_KEY` with the site key the admin interface\nshows after registering your app.\n```dart\n FGrecaptcha.verifyWithRecaptcha(SITE_KEY).then((result) {\n    // You can send the result token, along with some form fields, to your\n    // server, which can verify the token using an endpoint proved by the\n    // reCAPTCHA API for servers, see https://developers.google.com/recaptcha/docs/verify\n    }, onError: (e, s) {\n    // An error doesn't have to mean that the user is not a human. Errors\n    // can also occur when the sitekey is invalid or does not match your\n    // application, when the device is not supported or when a network\n    // error occurs.\n    // You should inform the user of errors, explaining why they can't\n    // proceed. As the plugin is not available for iOS, you might consider\n    // skipping the reCAPTCHA step when FGrecaptcha.isAvailable is false.\n    print(\"Could not verify:\\n $e at $s\");\n    }\n);\n```\n\n### Server-side verification\nSimply checking that `FGrecaptcha.verifyWithRecaptcha` returned a value is\nnot enough to be sure that the user is a human. Instead, you would have to\nverify the token returned in your applications backend server. You can\naccomplish that by following the instructions at https://developers.google.com/recaptcha/docs/verify.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimolus3%2Ff_grecaptcha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimolus3%2Ff_grecaptcha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimolus3%2Ff_grecaptcha/lists"}