Skip to content

Getting Started

Install

Install the package that matches your platform:

bash
# Core package (Web / Vanilla JS)
pnpm add @captcha-pro/core

# Vue 2
pnpm add @captcha-pro/vue2

# Vue 3
pnpm add @captcha-pro/vue

# React
pnpm add @captcha-pro/react

# Mini-program (WeChat / uni-app / Taro)
pnpm add @captcha-pro/weixin

For native platforms, see Platforms.

bash
# Flutter — add to pubspec.yaml
captcha_pro: ^2.0.0

# Android — add to build.gradle
implementation 'com.captcha.pro:captcha-sdk:2.0.0'

# iOS — CocoaPods
pod 'CaptchaPro', '~> 2.0.0'

Your First Captcha

html
<div id="captcha"></div>

<script type="module">
  import { SliderCaptcha } from '@captcha-pro/core'

  const captcha = new SliderCaptcha({
    el: '#captcha',
    width: 300,
    height: 170,
    onSuccess: () => console.log('Verification passed!'),
    onFail: () => console.log('Verification failed!')
  })
</script>

Requirements

  • Node.js: >=18
  • Browser: Chrome, Firefox, Safari, Opera, IE 11+ (IE11 needs a Promise polyfill)
  • Bundle size: ~35KB minified, no runtime dependencies

Build Outputs

FileFormatSizeUse Case
index.mjsESM35KBBundlers (webpack, vite, rollup)
index.cjsCommonJS36KBNode.js, older bundlers
index.global.jsIIFE57KBBrowser (development)
index.global.min.jsIIFE34KBBrowser (production)

Next Steps

Released under the MIT License.