@putin007/att-captcha-sdk-react
v0.1.9
Published
The client app must install React 18 and `go-captcha-react`.
Readme
@putin007/att-captcha-sdk-react
Install
The client app must install React 18 and go-captcha-react.
Public API
useFrontendSdk(source)FrontendSdkProvideruseFrontendSdkContext()GoCaptchaPuzzleWidget
For the demo app, import the delivery config exported by @putin007/att-captcha-sdk-core. The backend URL lives in the SDK source, not in a demo-side or workspace-root env file.
Example
import {
initAttCapchaSdk,
createGoCaptchaDirectBackendAdapter,
createGoCaptchaPuzzleAdapter,
} from '@putin007/att-captcha-sdk-core'
import { GoCaptchaPuzzleWidget } from '@putin007/att-captcha-sdk-react'
const sdk = initAttCapchaSdk({
puzzleAdapter: createGoCaptchaPuzzleAdapter({
type: 'rotate',
challengeEndpoint: '/api/go-captcha-data/rotate-basic',
}),
backendAdapter: createGoCaptchaDirectBackendAdapter({
verifyEndpoint: '/api/go-captcha-check-data/rotate-basic',
}),
})
export function CaptchaPanel() {
return <GoCaptchaPuzzleWidget instance={sdk} config={{ width: 300, height: 220, size: 220 }} />
}