Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__e2e__/host/
3 changes: 2 additions & 1 deletion Example.App.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ const App = () => {
// userJourney={true}
/>
<TouchableOpacity
testID="example-launch"
onPress={() => {
captchaForm.current.show();
}}>
<Text style={styles.paragraph}>Click to launch</Text>
</TouchableOpacity>
{code && (
<Text style={styles.codeContainer}>
<Text testID="example-status" style={styles.codeContainer}>
{'passcode or status: '}
<Text style={styles.codeText}>
{code}
Expand Down
14 changes: 13 additions & 1 deletion Hcaptcha.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ export type HcaptchaProps = {
* Whether to show a loading indicator while the hCaptcha web content loads
*/
showLoading?: boolean;
/**
* Load the SDK on mount without fetching a token. Call execute() to verify.
* Default: false.
*/
prewarm?: boolean;
/**
* Allow user to cancel hcaptcha during loading by touch loader overlay
*/
Expand Down Expand Up @@ -118,7 +123,14 @@ export type HcaptchaProps = {
interface CustomWebViewMessageEvent extends WebViewMessageEvent {
success: boolean;
reset: () => void;
/** Releases the WebView and cancels verification/timers. execute() recreates it. Retained event.reset() hooks become inert. */
destroy: () => void;
markUsed?: () => void;
}

export default class Hcaptcha extends React.Component<HcaptchaProps> {}
export default class Hcaptcha extends React.Component<HcaptchaProps> {
/** Queues verification until the SDK is ready. */
execute: () => void;
/** Cancels pending verification and resets the widget without executing. */
reset: () => void;
}
Loading
Loading