{"id":23131151,"url":"https://github.com/friendlycaptcha/friendly-captcha-android","last_synced_at":"2025-10-13T17:07:26.808Z","repository":{"id":266147578,"uuid":"877860651","full_name":"FriendlyCaptcha/friendly-captcha-android","owner":"FriendlyCaptcha","description":"Android SDK for Friendly Captcha","archived":false,"fork":false,"pushed_at":"2025-08-27T10:02:04.000Z","size":255,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-30T19:41:59.232Z","etag":null,"topics":["android","captcha","friendly-captcha","library","sdk"],"latest_commit_sha":null,"homepage":"https://developer.friendlycaptcha.com","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FriendlyCaptcha.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-10-24T11:20:28.000Z","updated_at":"2025-08-27T10:02:08.000Z","dependencies_parsed_at":"2025-09-12T10:34:14.336Z","dependency_job_id":"442ce1ad-172b-4c7a-a115-3069cc747e8a","html_url":"https://github.com/FriendlyCaptcha/friendly-captcha-android","commit_stats":null,"previous_names":["friendlycaptcha/friendly-captcha-android"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/FriendlyCaptcha/friendly-captcha-android","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendlyCaptcha%2Ffriendly-captcha-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendlyCaptcha%2Ffriendly-captcha-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendlyCaptcha%2Ffriendly-captcha-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendlyCaptcha%2Ffriendly-captcha-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FriendlyCaptcha","download_url":"https://codeload.github.com/FriendlyCaptcha/friendly-captcha-android/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FriendlyCaptcha%2Ffriendly-captcha-android/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279016278,"owners_count":26085827,"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-13T02:00:06.723Z","response_time":61,"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":["android","captcha","friendly-captcha","library","sdk"],"created_at":"2024-12-17T11:12:11.292Z","updated_at":"2025-10-13T17:07:26.777Z","avatar_url":"https://github.com/FriendlyCaptcha.png","language":"Kotlin","readme":"# Friendly Captcha Android SDK\n\n[![Maven Central Version](https://img.shields.io/maven-central/v/com.friendlycaptcha.android/friendly-captcha-android)\n](https://central.sonatype.com/artifact/com.friendlycaptcha.android/friendly-captcha-android) [![javadoc](https://javadoc.io/badge2/com.friendlycaptcha.android/friendly-captcha-android/javadoc.svg)](https://javadoc.io/doc/com.friendlycaptcha.android/friendly-captcha-android) \n\nThe Friendly Captcha Android SDK allows you to easily integrate [Friendly Captcha](https://friendlycaptcha.com) into your Android applications.\n\n\u003e This SDK is for **Friendly Captcha v2**.\n\n## Installation\n\nAdd the following to your `build.gradle` file:\n\n```gradle\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    implementation \"com.friendlycaptcha.android:friendly-captcha-android:1.1.0\"\n    // Or for `build.gradle.kts`\n    // implementation(\"com.friendlycaptcha.android:friendly-captcha-android:1.1.0\")\n}\n```\n\nYou can find the latest version number on the [Releases](https://github.com/FriendlyCaptcha/friendly-capthca-android/releases) page.\n\n## Documentation\n\nSee the documentation for the full API reference [here](https://javadoc.io/doc/com.friendlycaptcha.android/friendly-captcha-android).\n\n## Supported Platforms\n\nThe SDK supports **Android 4.1 Jelly Bean** (API level 16, released June 2012) and above. \n\nThis SDK is written in Kotlin and is compatible with both Kotlin and Java.\n\n## Usage\n\n### Kotlin (Compose)\n\nImport the Friendly Captcha SDK\n\n```kotlin\nimport com.friendlycaptcha.android.sdk.*;\n```\n\nThen create an instance of `FriendlyCaptchaSDK`, and create a widget with your site key:\n\n```kotlin\nconst val FRIENDLY_CAPTCHA_SITEKEY = \"YOUR_SITEKEY\"\n\nclass MainActivity : ComponentActivity() {\n    private val sdk by lazy {\n        FriendlyCaptchaSDK(context = this, apiEndpoint = \"global\")\n    }\n\n    private val widget by lazy {\n        sdk.createWidget(sitekey = FRIENDLY_CAPTCHA_SITEKEY)\n    }\n\n    // ...\n}\n```\n\nThen in the UI you are going to use the widget, add the following:\n\n```kotlin\n    val captchaResponse = remember { mutableStateOf(\"\") }\n    var buttonEnabled by remember { mutableStateOf(false) }\n\n    widget.setOnStateChangeListener { event -\u003e\n        captchaResponse.value = event.response\n\n        when (event.state) {\n            \"completed\" -\u003e buttonEnabled = true\n            // The user will be able to restart the widget by clicking it.\n            \"expired\" -\u003e buttonEnabled = false\n            // We enable the button on errors too, if Friendly Captcha is misbehaving (i.e. it's offline),\n            // the user can still submit the form (albeit without a valid captcha response).\n            \"error\" -\u003e buttonEnabled = true\n            \"reset\" -\u003e buttonEnabled = false\n        }\n    }\n\n    // The rest of your UI\n\n    AndroidView( // This is a Compose view that wraps the Friendly Captcha widget\n        factory = { _ -\u003e\n            widget.view\n        },\n    )\n\n    Button(\n        onClick = {\n            // Do something with the captcha response - usually you would send it to your backend\n            // for verification, along with the rest of the form data.\n            Log.d(\"MainActivity\", \"Captcha response: ${captchaResponse.value}\")\n\n            // Reset the widget after submitting the form, the captcha response is only valid once.\n            widget.reset()\n        },\n        enabled = buttonEnabled\n    ) {\n        Text(\"Submit\")\n    }\n```\n\nFor a full end-to-end example see the [example app](./example-app/).\n\n\n\n\n\n### Kotlin (AndroidView)\n\nIf you are not using Jetpack Compose, you can use the `AndroidView` API to embed the widget in your existing Android views. An example for that\ncan be found in the [debugapp](./sdk/debugapp/src/main/java/com/friendlycaptcha/android/debugapp/MainActivity.kt).\n\n### Kotlin Example App\n\u003cimg title=\"Example App Screenshot\" src=\"./example-app/screenshot.png\" width=\"560em\"\u003e\n\nThe example app demonstrates how to use the Friendly Captcha SDK in a simple Android app.\n\nTo run the example app, clone this repository and open the [`example-app`](./example-app) directory in Android Studio.\n\n## License\nThis is free software; you can redistribute it and/or modify it under the terms of the [Mozilla Public License Version 2.0](./sdk/LICENSE).\n\nAll examples are released under the [MIT license](./example-app/LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriendlycaptcha%2Ffriendly-captcha-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffriendlycaptcha%2Ffriendly-captcha-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriendlycaptcha%2Ffriendly-captcha-android/lists"}