Skip to content

Commit da82d68

Browse files
committed
[netlify-build] Vale, adding {:target="_blank"} to external links, screenshot audit
1 parent bf4b7aa commit da82d68

File tree

2 files changed

+25
-27
lines changed

2 files changed

+25
-27
lines changed

src/_includes/content/functions/settings.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ Settings allow you to pass configurable variables to your function, which is the
44

55
First, add a setting in **Settings** tab in the code editor:
66

7-
![Settings Tab](/docs/connections/functions/images/settings-tab-empty.png){:width="500"}
7+
![A screenshot of the functions settings tab](/docs/connections/functions/images/settings-tab-empty.png){:width="500"}
88

99
Click **Add Setting** to add your new setting.
1010

11-
![Add Setting Dialog](/docs/connections/functions/images/add-setting-dialog.png)
11+
![A screenshot of the "Add Setting" section of the functions settings tab, with apiKey settings included](/docs/connections/functions/images/add-setting-dialog.png)
1212

1313
You can configure the details about this setting, which change how it's displayed to anyone using your function:
1414

@@ -25,4 +25,4 @@ Click **Add Setting** to save the new setting.
2525

2626
Once you save a setting, it appears in the **Settings** tab for the function. You can edit or delete settings from this tab.
2727

28-
![Settings Tab](/docs/connections/functions/images/settings-tab-non-empty.png){:width="500"}
28+
![A screenshot of the functions settings tab, showing the apiKey setting](/docs/connections/functions/images/settings-tab-non-empty.png){:width="500"}

src/connections/functions/destination-functions.md

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,26 @@ Destination functions allow you to transform and annotate your Segment events an
1111
All functions are scoped to your workspace, so members of other workspaces can't view or use them.
1212

1313
> info ""
14-
> Functions is available to all customer plan types with a free allotment of usage hours. Read more about [Functions usage limits](/docs/connections/functions/usage/), or see [your workspace's Functions usage stats](https://app.segment.com/goto-my-workspace/settings/usage?metric=functions).
14+
> Functions is available to all customer plan types with a free allotment of usage hours. Read more about [Functions usage limits](/docs/connections/functions/usage/), or see [your workspace's Functions usage stats](https://app.segment.com/goto-my-workspace/settings/usage?metric=functions){:target="_blank"}.
1515
16-
![](images/destination_functions_overview.png)
16+
![An illusrative graphic showing information flowing from the Segment app, into code, and then into Slack](images/destination_functions_overview.png)
1717

1818

1919
> note ""
2020
> Destination functions does not accept data from [Object Cloud sources](/docs/connections/sources/#object-cloud-sources).
2121
2222
## Create a destination function
2323

24-
1. From your workspace, go to the Catalog and click the [Functions tab](https://app.segment.com/goto-my-workspace/functions/catalog).
24+
1. From your workspace, go to the Catalog and click the [Functions tab](https://app.segment.com/goto-my-workspace/functions/catalog){:target="_blank"}.
2525
2. Click **New Function**.
2626
3. Select **Destination Function** and click **Build**.
2727

2828
> success ""
29-
> **Tip:** Want to see some example functions? Check out the templates available in the Functions UI, or in the open-source [Segment Functions Library](https://github.com/segmentio/functions-library). (Contributions welcome!)
29+
> **Tip:** Want to see some example functions? Check out the templates available in the Functions UI, or in the open-source [Segment Functions Library](https://github.com/segmentio/functions-library){:target="_blank"}. (Contributions welcome!)
3030
3131
When you click **Build**, a code editor appears. Use the editor to write the code for your function, configure settings, and test the function's behavior.
3232

33-
![Functions Editor](images/editor-dest.png)
33+
<!--- ![A screenshot of the Functions Editor in the Segment app, showing one of the Segment sample functions and the test panel in the code editor](images/editor-dest.png) --->
3434

3535
## Code the destination function
3636

@@ -78,7 +78,7 @@ async function onTrack(event) {
7878
To change which event type the handler listens to, you can rename it to the name of the message type. For example, if you rename this function `onIdentify`, it listens for "Identify" events instead.
7979

8080
> info ""
81-
> Functions' runtime includes a `fetch()` polyfill using a `node-fetch` package. Check out the [node-fetch documentation](https://www.npmjs.com/package/node-fetch) for usage examples.
81+
> Functions' runtime includes a `fetch()` polyfill using a `node-fetch` package. Check out the [node-fetch documentation](https://www.npmjs.com/package/node-fetch){:target="_blank"} for usage examples.
8282
8383
### Errors and error handling
8484

@@ -140,16 +140,15 @@ You can read more about [error handling](#destination-functions-logs-and-errors)
140140
{% include content/functions/runtime.md %}
141141

142142

143-
<!-- TODO - could also go into the `runtime.md` include above, if applied identically to both types of functions.
144-
## Batching in functions -->
143+
<!-- TODO - could also go into the `runtime.md` include above, if applied identically to both types of functions. -->
145144

146145
## Create settings and secrets
147146

148147
{% include content/functions/settings.md %}
149148

150149
Next, fill out this setting's value in the **Test** tab, so you can run the function and verify that the correct setting value is passed. (This value is only for testing your function.)
151150

152-
![Test Value For Setting](images/setting-in-test-tab.png){:width="500"}
151+
<!-- ![Test Value For Setting](images/setting-in-test-tab.png){:width="500"} -->
153152

154153
Now that you've configured a setting and entered a test value, you can add code to read its value and run the function, as in the example below:
155154

@@ -162,8 +161,6 @@ async function onTrack(request, settings) {
162161

163162
When you deploy your destination function in your workspace, you fill out the settings on the destination configuration page, similar to how you would configure a normal destination.
164163

165-
![Destination Function Settings](images/dest-settings.png)
166-
167164
## Test the destination function
168165

169166
You can test your code directly from the editor in two ways:
@@ -172,15 +169,15 @@ You can test your code directly from the editor in two ways:
172169

173170
Click **Use Sample Event** and select the source to use events from.
174171

175-
![Capture events to test your function](images/autofill-events.gif)
172+
![An animation showing someone using the Use Sample Event button, selecting a source, and clicking "Use Event"](images/autofill-events.gif)
176173

177174
Click **Run** to test your function with the event you selected.
178175

179176
### Test using manual input
180177

181178
You can also manually include your own JSON payload of a Segment event, instead of fetching a sample from one of your workspace sources.
182179

183-
![Functions Editor Event Tester](images/editor-test.gif)
180+
![An animation showing someone clicking the run button in the Test panel and viewing a successful output](images/editor-test.gif)
184181

185182
If your function fails, you can check the error details and logs in the **Output** section.
186183

@@ -282,9 +279,12 @@ By default, Functions waits up to 10 seconds to form a batch of 20 events. You c
282279

283280
### Test the batch handler
284281

285-
The [Functions editing environment](/docs/connections/functions/environment/) supports testing batch handlers. In the right panel of the Functions editor, click **customize the event yourself** to enter Manual Mode. Add events as a JSON array, with one event per element. Click **Run** to preview the batch handler with the specified events.
282+
The [Functions editing environment](/docs/connections/functions/environment/) supports testing batch handlers.
286283

287-
![Batch handler testing](images/batch-function-editor.png)
284+
To test the batch handler:
285+
1. In the right panel of the Functions editor, click **customize the event yourself** to enter Manual Mode.
286+
2. Add events as a JSON array, with one event per element.
287+
3. Click **Run** to preview the batch handler with the specified events.
288288

289289
> note ""
290290
> The Sample Event option tests single events only. You must use Manual Mode to add more than one event so you can test batch handlers.
@@ -322,12 +322,12 @@ You can also choose to **Save & Deploy** to save the changes, and then choose wh
322322

323323
A function can throw errors, or Segment might encounter errors while invoking your function. You can view these errors in the [Event Delivery](/docs/connections/event-delivery/) tab for your Destination as in the example below.
324324

325-
![Destination Function Event Delivery tab](images/event-delivery.png)
325+
![A screenshot of the event delivery tab, showing 519 failed events broken into categories explaining why they failed](images/event-delivery.png)
326326

327327
### Destination functions error types
328328

329329
- **Bad Request** - Any error thrown by the function code that is not covered by the other errors.
330-
- **Invalid Settings** - A configuration error prevented Segment from executing your code. If this error persists for more than an hour, [contact Segment Support](https://segment.com/help/contact/).
330+
- **Invalid Settings** - A configuration error prevented Segment from executing your code. If this error persists for more than an hour, [contact Segment Support](https://segment.com/help/contact/){:target="_blank"}.
331331
- **Message Rejected** - Your code threw `InvalidEventPayload` or `ValidationError` due to invalid input.
332332
- **Unsupported Event Type** - Your code does not implement a specific event type (`onTrack()`, etc.) or threw a `EventNotSupported` error.
333333
- **Retry** - Your code threw `RetryError` indicating that the function should be retried.
@@ -340,9 +340,7 @@ If your function throws an error, execution halts immediately. Segment captures
340340

341341
Segment then displays the captured error information in the [Event Delivery](/docs/connections/event-delivery/) page for your destination function. You can use this information to find and fix unexpected errors.
342342

343-
![Destination Function error logs](images/error-logs-dest.png)
344-
345-
You can throw [an error or a custom error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) and you can also add helpful context in logs using the [`console` API](https://developer.mozilla.org/en-US/docs/Web/API/console). For example:
343+
You can throw [an error or a custom error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error){:target="_blank"} and you can also add helpful context in logs using the [`console` API](https://developer.mozilla.org/en-US/docs/Web/API/console){:target="_blank"}. For example:
346344

347345
```js
348346
async function onTrack(event, settings) {
@@ -394,7 +392,7 @@ async function getAccessToken () {
394392

395393
### Editing and deleting functions
396394

397-
If you are a **Workspace Owner** or **Functions Admin**, you can manage your function from the [Functions](https://app.segment.com/goto-my-workspace/functions/catalog) page.
395+
If you are a **Workspace Owner** or **Functions Admin**, you can manage your function from the [Functions](https://app.segment.com/goto-my-workspace/functions/catalog){:target="_blank"} page.
398396

399397

400398
### Monitoring destination functions
@@ -429,19 +427,19 @@ Yes, Functions access is logged in the [Audit Trail](/docs/segment-app/iam/audit
429427

430428
##### Does Segment retry failed function invocations?
431429

432-
Segment retries 9 times over the course of 4 hours. This increases the number of attempts for messages, so we try to re-deliver them another 4 times after some backoff. Segment doesn't retry if your function throws a [non-recoverable error](#errors-and-error-handling).
430+
Segment retries 9 times over the course of 4 hours. This increases the number of attempts for messages, so Segment tries to re-deliver them another 4 times after some backoff. Segment doesn't retry if your function throws a [non-recoverable error](#errors-and-error-handling).
433431

434432
##### Are events guaranteed to send data in order?
435433

436434
No, Segment can't guarantee the order in which the events are delivered to an endpoint.
437435

438436
##### Can I create a device-mode destination?
439437

440-
No, destination functions are currently available as cloud-mode destinations only. We're in the early phases of exploration and discovery for supporting customer "web plugins" for custom device-mode destinations and other use cases, but this is unsupported today.
438+
No, destination functions are currently available as cloud-mode destinations only. Segment is in the early phases of exploration and discovery for supporting customer "web plugins" for custom device-mode destinations and other use cases, but this is unsupported today.
441439

442440
##### How do I publish a destination to the public Segment catalog?
443441

444-
If you are a partner, looking to publish your destination and distribute your app through Segment catalog, visit the [Developer Center](https://segment.com/partners/developer-center/) and check out our [partner docs](/docs/partners/).
442+
If you are a partner, looking to publish your destination and distribute your app through Segment catalog, visit the [Developer Center](https://segment.com/partners/developer-center/){:target="_blank"} and check out the Segment [partner docs](/docs/partners/).
445443

446444
##### How does batching affect visibility?
447445

0 commit comments

Comments
 (0)