{"id":32285125,"url":"https://github.com/nnnggel/gcaptcha","last_synced_at":"2025-10-23T01:43:19.455Z","repository":{"id":48498653,"uuid":"264080480","full_name":"nnnggel/gCaptcha","owner":"nnnggel","description":"A flutter plugin for reCAPTCHA v2 - android. The FREE anti-abuse service.","archived":false,"fork":false,"pushed_at":"2021-07-22T17:49:33.000Z","size":965,"stargazers_count":3,"open_issues_count":8,"forks_count":12,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-23T01:42:51.847Z","etag":null,"topics":["dart","flutter","flutter-plugin","google-captcha","recaptcha"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/g_captcha","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nnnggel.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":"2020-05-15T02:53:33.000Z","updated_at":"2022-04-03T03:00:27.000Z","dependencies_parsed_at":"2022-08-27T17:02:00.292Z","dependency_job_id":null,"html_url":"https://github.com/nnnggel/gCaptcha","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/nnnggel/gCaptcha","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnnggel%2FgCaptcha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnnggel%2FgCaptcha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnnggel%2FgCaptcha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnnggel%2FgCaptcha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nnnggel","download_url":"https://codeload.github.com/nnnggel/gCaptcha/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nnnggel%2FgCaptcha/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280546407,"owners_count":26348721,"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","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["dart","flutter","flutter-plugin","google-captcha","recaptcha"],"created_at":"2025-10-23T01:43:14.113Z","updated_at":"2025-10-23T01:43:19.449Z","avatar_url":"https://github.com/nnnggel.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Flutter g_captcha \nA flutter plugin for [reCAPTCHA](https://developers.google.com/recaptcha/intro) [v2 - android](https://developer.android.com/training/safetynet/recaptcha.html). The FREE anti-abuse service.\n\n## What is reCAPTCHA?\nreCAPTCHA is a free service that protects your site from spam and abuse. It uses advanced risk analysis engine to tell humans and bots apart. With the new API, a significant number of your valid human users will pass the reCAPTCHA challenge without having to solve a CAPTCHA (See blog for more details). reCAPTCHA comes in the form of a widget that you can easily add to your blog, forum, registration form, etc.\n\nPlease check [docs](https://developers.google.com/recaptcha/intro) for further details.\n\n## Sign up for an API key pair\nTo use reCAPTCHA, you need to [sign up for an API key pair](https://www.google.com/recaptcha/admin) for your site. The key pair consists of a site key and secret. The site key is used to display the widget on your site. The secret authorizes communication between your application backend and the reCAPTCHA server to verify the user's response. The secret needs to be kept safe for security purposes.\n\nConfig 'android package name' to reCaptcha's admin console\n\u003e You need to add 'android package name' to reCaptcha's [admin console](https://www.google.com/recaptcha/admin/create), or you will always get error: RECAPTCHA_INVALID_PACKAGE_NAME\n\n## Usage\n\n### 1. Add dependency to [pubspec.yaml](https://dart.dev/tools/pub/dependencies)\n\u003e dependencies:  \n\u003e ....g_captcha: ^1.0.0\n\nDon't forget this\n\u003e flutter pub get\n    \n### 2. Import in dart file\n\u003e import 'package:g_captcha/g_captcha.dart';\n\n### 3. Config CAPTCHA_SITE_KEY and Call out \n\u003e const String CAPTCHA_SITE_KEY = \"CAPTCHA_SITE_KEY_HERE\";  \n\u003e ...  \n\u003e String tokenResult = await GCaptcha.reCaptcha(CAPTCHA_SITE_KEY);  \n\u003e print('tokenResult: $tokenResult');\n\n![avatar](https://github.com/nnnggel/gCaptcha/blob/master/snapshot.png)\n\n## Verify token (java with okhttp demo)\n\u003e https://developers.google.com/recaptcha/docs/verify\n```\npackage com.yuanchongyu.recapcha;\n\nimport okhttp3.FormBody;\nimport okhttp3.RequestBody;\nimport okhttp3.Response;\nimport org.json.JSONObject;\n\npublic class Main {\n\n    // TODO\n    private static final String RECAPTCHA_SECRET_KEY = \"RECAPTCHA_SECRET_KEY_HERE\";\n\n    private static final String RECAPTCHA_VERIFY_URL = \"https://www.google.com/recaptcha/api/siteverify\";\n\n    public static void main(String[] args) throws Exception {\n        // TODO\n        boolean success = verify(\"03AGdBq25vYY080h0Wvk-XpCkhvEoBxS2YK-EbGqWq5Ru_hWxCt2XfGr7S8LMB9z3aU411MGXRoTSIQ_OvBeFSIqLNsxLyOUDCFOXzh1DYGMbaMvnc0FfqnfFc1yWu3fK6fYNSb09QVbUKeuifpYo6GBX6GiqOEu-AjIbZMz8TxkBUbBw9VpQG2PmfREPNwV6dWVpEQe4-oy-SP3IL94DFdTrkRoYQoCfZsSpTuGXh1gepxuqn-VJOBbxeFy_Qsha1BFYRvp2reifIX9Fd18jcToYI1OVLhQmRgM1shYNoszAnRjVSGFNfE6M\");\n        System.out.println(\"verify result: \" + success);\n    }\n\n    private static boolean verify(String token) throws Exception {\n        RequestBody formBody = new FormBody.Builder().add(\"secret\", RECAPTCHA_SECRET_KEY).add(\"response\", token)\n            .build();\n        Response response = post(RECAPTCHA_VERIFY_URL, formBody);\n        String resp = response.body().string();\n        return new JSONObject(resp).getBoolean(\"success\");\n    }\n\n    private Response post(String url, RequestBody body) throws IOException {\n        Request request = new Request.Builder().url(url).post(body).build();\n        Response response = httpClient.newCall(request).execute();\n        if (!response.isSuccessful()) {\n            throw new IOException(\"request error: \" + response);\n        }\n        return response;\n    }\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnnnggel%2Fgcaptcha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnnnggel%2Fgcaptcha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnnnggel%2Fgcaptcha/lists"}