Skip to content

Commit 061558c

Browse files
authored
Merge pull request #79 from FriendlyCaptcha/update-sdk-reference
Update SDK reference documentation
2 parents 077f28c + 459c3f5 commit 061558c

File tree

6 files changed

+47
-3
lines changed

6 files changed

+47
-3
lines changed

docs/sdk/reference/sdk.frcwidgetstatechangeeventdata.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export interface FRCWidgetStateChangeEventData
2424
| --- | --- | --- | --- |
2525
| [error?](./sdk.frcwidgetstatechangeeventdata.error.md) | | [WidgetErrorData](./sdk.widgeterrordata.md) | _(Optional)_ The error that caused the state change, if any. Undefined if <code>state</code> is not equal to <code>&quot;error&quot;</code>. |
2626
| [id](./sdk.frcwidgetstatechangeeventdata.id.md) | | string | The widget ID that the event originated from. |
27+
| [mode?](./sdk.frcwidgetstatechangeeventdata.mode.md) | | [WidgetMode](./sdk.widgetmode.md) | _(Optional)_ The WidgetMode returned from the API. Smart Mode intelligently chooses between One-click Mode ("interactive") and Zero-click Mode ("noninteractive"). The mode is configured in the Friendly Captcha dashboard. |
2728
| [name](./sdk.frcwidgetstatechangeeventdata.name.md) | | typeof [FRCWidgetStateChangeEventName](./sdk.frcwidgetstatechangeeventname.md) | <code>&quot;frc:widget.statechange&quot;</code> |
2829
| [response](./sdk.frcwidgetstatechangeeventdata.response.md) | | string | The current <code>frc-captcha-response</code> value. |
2930
| [state](./sdk.frcwidgetstatechangeeventdata.state.md) | | [WidgetState](./sdk.widgetstate.md) | The new state of the widget. |
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
id: sdk.frcwidgetstatechangeeventdata.mode
3+
title: FRCWidgetStateChangeEventData.mode
4+
hide_title: true
5+
sidebar_class_name: sidebar-hidden
6+
---
7+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
8+
9+
[@friendlycaptcha/sdk](./sdk.md) &gt; [FRCWidgetStateChangeEventData](./sdk.frcwidgetstatechangeeventdata.md) &gt; [mode](./sdk.frcwidgetstatechangeeventdata.mode.md)
10+
11+
## FRCWidgetStateChangeEventData.mode property
12+
13+
The WidgetMode returned from the API. Smart Mode intelligently chooses between One-click Mode ("interactive") and Zero-click Mode ("noninteractive"). The mode is configured in the Friendly Captcha dashboard.
14+
15+
**Signature:**
16+
17+
```typescript
18+
mode?: WidgetMode;
19+
```
20+
21+
## Remarks
22+
23+
The API chooses the mode during activation, meaning that the mode will not be available prior to the `"activated"` state. In other words, `mode` will be only be present for `"activated"`<!-- -->, `"requesting"`<!-- -->, `"solving"`<!-- -->, `"verifying"`<!-- -->, `"completed"`<!-- -->, and `"error"`<!-- -->. For other states, it will be `undefined`<!-- -->. See the [widget lifecycle](../lifecycle) docs for more information.

docs/sdk/reference/sdk.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,6 @@ A library for integrating Friendly Captcha into your website. This SDK allows yo
5858
| [SentinelResponse](./sdk.sentinelresponse.md) | Response values used in the hidden input field when no valid solution is present, these tell you something about the state of the widget. |
5959
| [StartMode](./sdk.startmode.md) | <p>The start mode of the widget.</p><p>\* <code>&quot;auto&quot;</code>: the widget gets activated as soon as it is created. \* <code>&quot;focus&quot;</code>: the widget gets activated as soon as the form above it is focused. \* <code>&quot;none&quot;</code>: The widget does not get activated automatically at all, the user needs to press the widget (or <code>.start()</code> gets called using the Javascript API).</p> |
6060
| [WidgetErrorCode](./sdk.widgeterrorcode.md) | <p>Error codes that can be returned by the widget.</p><p>\* <code>&quot;network_error&quot;</code>: The user's browser could not connect to the Friendly Captcha API. \* <code>&quot;sitekey_invalid&quot;</code>: The sitekey is invalid. \* <code>&quot;sitekey_missing&quot;</code>: The sitekey is missing. \* <code>&quot;other&quot;</code>: Some other error occurred.</p><p>In all cases it's the best practice to enable the "submit" button when the widget errors, so that the user can still perform the action despite not having solved the captcha.</p> |
61+
| [WidgetMode](./sdk.widgetmode.md) | The mode of the widget. \* <code>&quot;interactive&quot;</code> (default): the widget is interactive: the user needs to click the checkbox to finalize the captcha. This mode offers the best anti-bot protection. \* <code>&quot;noninteractive&quot;</code>: the widget is non-interactive: the captcha is solved without any user interaction required. |
6162
| [WidgetResetTrigger](./sdk.widgetresettrigger.md) | What caused the widget to reset. \* <code>root</code>: Code on the root page (= your website code or plugin) caused the reset. \* <code>widget</code>: The reset came from the widget. The user likely clicked the reset button within the widget. \* <code>agent</code>: The reset came from the agent - this currently does not happen but may in the future. |
62-
| [WidgetState](./sdk.widgetstate.md) | The state the widget is in. See the \[widget lifecycle\](../lifecycle) docs for more information. |
63+
| [WidgetState](./sdk.widgetstate.md) | The state the widget is in. See the [widget lifecycle](../lifecycle) docs for more information. |

docs/sdk/reference/sdk.sentinelresponse.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ Response values used in the hidden input field when no valid solution is present
1515
**Signature:**
1616

1717
```typescript
18-
export type SentinelResponse = ".UNINITIALIZED" | ".UNCONNECTED" | ".UNSTARTED" | ".REQUESTING" | ".SOLVING" | ".VERIFYING" | ".EXPIRED" | ".DESTROYED" | ".ERROR" | ".RESET";
18+
export type SentinelResponse = ".UNINITIALIZED" | ".UNCONNECTED" | ".UNSTARTED" | ".REQUESTING" | ".SOLVING" | ".VERIFYING" | ".EXPIRED" | ".DESTROYED" | ".ERROR" | ".ERROR.UNREACHABLE" | ".RESET";
1919
```
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
id: sdk.widgetmode
3+
title: WidgetMode
4+
hide_title: true
5+
sidebar_class_name: sidebar-hidden
6+
---
7+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
8+
9+
[@friendlycaptcha/sdk](./sdk.md) &gt; [WidgetMode](./sdk.widgetmode.md)
10+
11+
## WidgetMode type
12+
13+
The mode of the widget. \* `"interactive"` (default): the widget is interactive: the user needs to click the checkbox to finalize the captcha. This mode offers the best anti-bot protection. \* `"noninteractive"`<!-- -->: the widget is non-interactive: the captcha is solved without any user interaction required.
14+
15+
**Signature:**
16+
17+
```typescript
18+
export type WidgetMode = "interactive" | "noninteractive";
19+
```

docs/sdk/reference/sdk.widgetstate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ sidebar_class_name: sidebar-hidden
1010

1111
## WidgetState type
1212

13-
The state the widget is in. See the \[widget lifecycle\](../lifecycle) docs for more information.
13+
The state the widget is in. See the [widget lifecycle](../lifecycle) docs for more information.
1414

1515
**Signature:**
1616

0 commit comments

Comments
 (0)