Run the Examples (No Coding Experience Needed)
This project ships with runnable examples for every supported platform. This page is a quick hub — pick a platform, install one or two pieces of software, and you'll have a live captcha on screen.
Each section links to that example's README for the full step-by-step (download links, install steps, what to click, common errors).
Prerequisites (all platforms)
- Node.js 18 LTS — download from https://nodejs.org (pick the LTS
.msion Windows /.pkgon macOS, double-click to install). - pnpm — after Node is installed, open a terminal and run
npm install -g pnpm. - A terminal: Windows → search "PowerShell" in the Start menu; macOS → "Terminal" (Launchpad → Other).
Clone or download this repo, open a terminal in the project root, and run:
pnpm install # first run takes a few minutes; wait for DoneIf
pnpm installreports a Python/canvas error (only thecorepackage), it won't stop you running the examples — ignore it. If you must build core, install Python 3.11 and runPYTHON=/usr/local/bin/python3.11 pnpm install.
Web (fastest way to see it)
From the project root:
pnpm play:vue # or: pnpm play:react | pnpm play:vue2Copy the printed http://localhost:5173 into your browser — the captcha appears.
- examples/vue/README.md
- examples/react/README.md
- examples/vue2/README.md
- examples/html/README.md — pure HTML+CDN, no install needed, just open
index.html
WeChat Mini-Program
Install WeChat DevTools: https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html
For Taro / uni-app examples, build first (output goes to
dist/):bashcd examples/taro-vue # or taro-vue2 / taro-react pnpm install pnpm dev:weapp # uni-app uses: pnpm dev:mp-weixinThe
weixinexample is native — no build step.Open WeChat DevTools → Import project → select the example dir (or its
dist/for Taro/uni-app) → use a Test AppID → the simulator shows the captcha.
Native (Android / iOS / Flutter)
These are SDK libraries, not standalone apps — you can build them, but there's no UI to view directly. To see the captcha visually, use the Web example above.
- Android — install Android Studio (it bundles the JDK) → open
packages/android→ wait for Gradle sync → Build → Make Project. Command line:./gradlew :captcha-sdk:assembleDebug :captcha-compose:assembleDebug. (README) - iOS (macOS only) — install Xcode → open
packages/ios/Package.swift→ ⌘B. Command line:xcodebuild -scheme CaptchaPro -destination 'generic/platform=iOS' -derivedDataPath .build build. Do not useswift build(it targets macOS and fails withno such module 'UIKit'). (README) - Flutter — install the Flutter SDK →
cd packages/flutter && flutter analyze→No issues found!. It's a plugin package, soflutter build apkis expected to fail with "Target file lib/main.dart not found" —flutter analyzeis the correct check. (README)
Backend demos
Each backend serves the captcha API on a different port. Open http://localhost:<port>/api/captcha?type=slider in a browser — you should get JSON back.
| Backend | Port | Run |
|---|---|---|
| Node.js | 3001 | cd server/node && pnpm install && pnpm dev |
| Go | 8082 | cd server/go && go run cmd/server/main.go |
| Java | 8080 | cd server/java && mvn spring-boot:run (install Maven first — the project has no wrapper) |
Verify it works
- Web — the browser shows the captcha at
localhost:5173. - Mini-program — the WeChat DevTools simulator shows the captcha.
- Native — the build prints
BUILD SUCCESSFUL/BUILD SUCCEEDED/No issues found!. - Backend —
http://localhost:<port>/api/captcha?type=sliderreturns JSON.
If something fails, see the matching README's "Common errors" section.