Skip to content

Commit fd7905f

Browse files
committed
Address PR review comments for Salesforce integration docs
1 parent 04bd9d9 commit fd7905f

3 files changed

Lines changed: 52 additions & 45 deletions

File tree

src/pages/integrations/salesforce/index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ description: Integrate Friendly Captcha into your Salesforce environment
1212
Integrating Friendly Captcha involves a front-end component and a back-end component. We recommend familiarizing yourself with the [Friendly Captcha documentation][fcdocs] to develop a baseline understanding of how an integration works.
1313

1414
For the front-end component of the integration, this package provides a Lightning Web
15-
Component (LWC). If you're using Visualforce, you should also be able to simply insert
16-
[the standard markup][html] for the front-end integration.
15+
Component (LWC). If you're using Visualforce, you should be able to insert
16+
[the standard markup][html] for the front-end integration, instead of using the LWC.
1717

1818
For the back-end component of the integration, this package provides an Apex class that
1919
performs an HTTP request to the Friendly Captcha site verification API.
@@ -53,10 +53,10 @@ Click the **Manage Records** link, and then edit the **Settings** record. You'll
5353

5454
| Setting | Location | Description |
5555
| -- | -- | -- |
56-
| Sitekey | Shared | A Friendly Captcha sitekey associated with an application. Copied from the application configuration in the Friendly Captcha dashboard. |
56+
| Sitekey | Shared | A Friendly Captcha sitekey associated with an application. You can find this value in the application configuration in the Friendly Captcha dashboard. |
5757
| APIEndpoint | Shared | The endpoint URL used for communicating with the Friendly Captcha API. Shorthands 'eu' or 'global' are accepted. Default is 'global'. Using the 'eu' endpoint requires access that must be enabled in the Friendly Captcha dashboard. |
58-
| APIKey | Apex | An API key used for communicating with the Friendly Captcha API. Created in the Friendly Captcha dashboard. |
59-
| Strict | Apex | Determines the failure mode behavior of the captcha response verification (siteverify) result. This mode only applies when the API was not able to verify the response, which might occur for network connectivity reasons or a misconfiguration of the client. When 'strict' is enabled, unverified responses will be set to 'reject', in a fail-closed behavior. When disabled (the default), unverified responses will be set to 'accept', in a fail-open behavior. |
58+
| APIKey | Apex | An API key used for communicating with the Friendly Captcha API. You can create an API key in the Friendly Captcha dashboard. |
59+
| Strict | Apex | Determines the failure mode behavior of the captcha response verification (siteverify) result. This mode only applies when the API was not able to verify the response, which might occur for network connectivity reasons or a misconfiguration of the client. When 'strict' is enabled, unverified responses will be set to 'reject' (i.e. fail-closed behavior). When disabled (the default), unverified responses will be set to 'accept' (i.e. fail-open behavior). |
6060
| Timeout | Apex | How long (in milliseconds) to wait for a captcha response verification request to complete. |
6161
| StartMode | LWC | The start mode determines the behavior around automatic activation of the widget. Activation here means the challenge gets requested and gets solved. |
6262
| Theme | LWC | The theme for the widget. |
@@ -196,7 +196,7 @@ Here's the final Flow:
196196

197197
### Lightning Web Component
198198

199-
Using the LWC from code (e.g., from within another LWC) looks like this:
199+
Using the LWC from code (e.g. from within another LWC) looks like this:
200200

201201
```
202202
<friendlycaptcha-widget
Lines changed: 43 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
11
# VerifyResult Class
22

33
VerifyResult is a wrapper around the response of an
4-
/api/v2/captcha/siteverify request.
4+
`/api/v2/captcha/siteverify` request.
55

66
The main methods are `shouldAccept` and `wasAbleToVerify` .
77
The first one you should use to determine if the user&#x27;s request should be accepted;
88
the second one to determine if the request was able to be verified.
9-
If that returns false, you should alert yourself.
9+
If that returns false, it means that there was an issue in the communication with the
10+
Friendly Captcha API, and you should log an error or notify your monitoring system.
1011

1112
## Methods
1213
### `isStrict()`
1314

15+
Whether the `strict` option was set to true on the client.
16+
In `strict` mode this will only return `true` if the request was successful
17+
(e.g. verification could happen), and the challenge was solved successfully.
18+
19+
By default, `strict` is set to `false` , which means that the request
20+
will be accepted if the challenge could not be verified (also called *fail open*).
21+
1422
#### Signature
1523
```apex
1624
global Boolean isStrict()
@@ -19,13 +27,13 @@ global Boolean isStrict()
1927
#### Return Type
2028
**Boolean**
2129

22-
whether the ,[object Object], option was set to true on the client. In,[object Object], ,[object Object], mode this will only return ,[object Object],[object Object], if the request was successful (e.g. verification could happen), and,[object Object], the challenge was solved successfully.,[object Object],,[object Object], By default, ,[object Object], is set to ,[object Object],, which means that the request,[object Object], will be accepted if the challenge could,[object Object], not be verified (also called *fail open*).
23-
2430
---
2531

2632
### `shouldAccept()`
2733

28-
Determines if the user&#x27;s request should be accepted.
34+
Determines if the user&#x27;s request should be accepted.
35+
36+
Returns true if the request should be accepted, false otherwise.
2937

3038
#### Signature
3139
```apex
@@ -35,13 +43,13 @@ global Boolean shouldAccept()
3543
#### Return Type
3644
**Boolean**
3745

38-
true if the request should be accepted, false otherwise.
39-
4046
---
4147

4248
### `shouldReject()`
4349

44-
Determines if the user&#x27;s request should be rejected.
50+
Determines if the user&#x27;s request should be rejected.
51+
52+
Returns rue if the request should be rejected, false otherwise.
4553

4654
#### Signature
4755
```apex
@@ -51,14 +59,14 @@ global Boolean shouldReject()
5159
#### Return Type
5260
**Boolean**
5361

54-
true if the request should be rejected, false otherwise.
55-
5662
---
5763

5864
### `isEncodeError()`
5965

6066
Was unable to encode the captcha response. This means the captcha response
61-
was invalid and should never be accepted.
67+
was invalid and should never be accepted.
68+
69+
Returns rue if there was an encoding error, false otherwise.
6270

6371
#### Signature
6472
```apex
@@ -68,14 +76,14 @@ global Boolean isEncodeError()
6876
#### Return Type
6977
**Boolean**
7078

71-
true if there was an encoding error, false otherwise.
72-
7379
---
7480

7581
### `isRequestError()`
7682

7783
Something went wrong making the request to the Friendly Captcha API, perhaps
78-
there is a network connection issue?
84+
there is a network connection issue?
85+
86+
Returns true if there was a request error, false otherwise.
7987

8088
#### Signature
8189
```apex
@@ -85,13 +93,13 @@ global Boolean isRequestError()
8593
#### Return Type
8694
**Boolean**
8795

88-
true if there was a request error, false otherwise.
89-
9096
---
9197

9298
### `isDecodeError()`
9399

94-
Something went wrong decoding the response from the Friendly Captcha API.
100+
Something went wrong decoding the response from the Friendly Captcha API.
101+
102+
Returns true if there was a decoding error, false otherwise.
95103

96104
#### Signature
97105
```apex
@@ -101,8 +109,6 @@ global Boolean isDecodeError()
101109
#### Return Type
102110
**Boolean**
103111

104-
true if there was a decoding error, false otherwise.
105-
106112
---
107113

108114
### `isClientError()`
@@ -111,7 +117,9 @@ Something went wrong on the client side, this generally means your
111117
configuration is wrong.
112118
Check your secrets (API key) and sitekey.
113119

114-
See `response.error` for more details.
120+
See `response.error` for more details.
121+
122+
Returns true if there was a client error, false otherwise.
115123

116124
#### Signature
117125
```apex
@@ -121,14 +129,14 @@ global Boolean isClientError()
121129
#### Return Type
122130
**Boolean**
123131

124-
true if there was a client error, false otherwise.
125-
126132
---
127133

128134
### `getResponse()`
129135

130136
Get the response as was sent from the server.
131-
This can be null if the request to the API could not be made successfully.
137+
This can be null if the request to the API could not be made successfully.
138+
139+
Returns the response from the server, or null if the request failed.
132140

133141
#### Signature
134142
```apex
@@ -138,13 +146,13 @@ global VerifyResponse getResponse()
138146
#### Return Type
139147
**[VerifyResponse](VerifyResponse)**
140148

141-
the response from the server, or null if the request failed.
142-
143149
---
144150

145151
### `getErrorCode()`
146152

147-
Get the error code.
153+
Get the error code.
154+
155+
Returns the error code, or null if not present.
148156

149157
#### Signature
150158
```apex
@@ -154,13 +162,13 @@ global String getErrorCode()
154162
#### Return Type
155163
**String**
156164

157-
the error code, or null if not present.
158-
159165
---
160166

161167
### `getErrorDetail()`
162168

163-
Get the error detail.
169+
Get the error detail.
170+
171+
Returns the error detail, or null if not present.
164172

165173
#### Signature
166174
```apex
@@ -170,16 +178,16 @@ global String getErrorDetail()
170178
#### Return Type
171179
**String**
172180

173-
the error detail, or null if not present.
174-
175181
---
176182

177183
### `wasAbleToVerify()`
178184

179185
Whether the request to verify the captcha was completed. In other words: the
180186
API responded with status 200.
181187
If this is false, you should notify yourself and check `getErrorCode()` to see
182-
what is wrong.
188+
what is wrong.
189+
190+
Returns true if the request was able to be verified, false otherwise.
183191

184192
#### Signature
185193
```apex
@@ -189,13 +197,13 @@ global Boolean wasAbleToVerify()
189197
#### Return Type
190198
**Boolean**
191199

192-
true if the request was able to be verified, false otherwise.
193-
194200
---
195201

196202
### `getException()`
197203

198-
Get the exception that was thrown, if any.
204+
Get the exception that was thrown, if any.
205+
206+
Returns the exception, or null if none was thrown.
199207

200208
#### Signature
201209
```apex
@@ -205,7 +213,5 @@ global Exception getException()
205213
#### Return Type
206214
**Exception**
207215

208-
the exception, or null if none was thrown.
209-
210216
## Classes
211217
### NullErrorException Class

src/pages/integrations/salesforce/reference/index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@ For more information, see [the API response documentation](/docs/v2/api/siteveri
3535
### [VerifyResult](classes/VerifyResult)
3636

3737
VerifyResult is a wrapper around the response of an
38-
/api/v2/captcha/siteverify request.
38+
`/api/v2/captcha/siteverify` request.
3939

4040
The main methods are `shouldAccept` and `wasAbleToVerify` .
4141
The first one you should use to determine if the user&#x27;s request should be accepted;
4242
the second one to determine if the request was able to be verified.
43-
If that returns false, you should alert yourself.
43+
If that returns false, it means that there was an issue in the communication with the
44+
Friendly Captcha API, and you should log an error or notify your monitoring system.
4445

4546
## Custom Objects
4647

0 commit comments

Comments
 (0)