You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/connections/sources/catalog/libraries/website/javascript/index.md
+6-19Lines changed: 6 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -683,29 +683,16 @@ Here are some examples of using `addSourceMiddleware` for enrichment and validat
683
683
});
684
684
```
685
685
686
-
### Plugin categories
687
-
Plugins are bound by Analytics 2.0 which handles operations such as observability, retries, and error handling. There are two different categories of plugins:
688
-
***Critical Plugins**:
689
-
- Errors thrown in`load()` will completely stop segment from initializing.
|`before`| Executes before event processing begins. These are plugins that run before any other plugins run. <br><br> See the example of how Analytics.js uses the [EventValidationplugin](https://github.com/segmentio/analytics-next/blob/master/packages/browser/src/plugins/validation/index.ts){:target="_blank"} to verify that every event has the correct shape.<br><br> Source middleware added via `addSourceMiddleware` is treated as a before plugin. |
|`destination`|Executesaseventsbegintopassofftodestinations. <br><br>Thisdoesn't modify the event outside of the specific destination, and failure doesn'thalttheexecution. |
691
+
|`before`| Executes before event processing begins. These are plugins that run before any other plugins run. Thrown errors here can block the eventpipeline. Source middleware added via `addSourceMiddleware` is treated as a `before` plugin. |
692
+
|`enrichment`| Executes as the first level ofeventprocessing. These plugins modify an event. Thrown errors here can block the event pipeline. |
693
+
|`destination`| Executes as events begin to pass off to destinations. Segment.io is implemented as a destination plugin. Thrown errors here will _not_ block the event pipeline. |
707
694
|`after`| Executes after all event processing completes. You can use this to perform cleanup operations. |
|`utility`| Executes _only once_ during the analytics.jsbootstrap. Givesyou access to the analytics instance via the plugin's `load()` method. This doesn't allow you to modify events. |
709
696
710
697
### Example plugins
711
698
Here's an example of a plugin that converts all track event names to lowercase before the event goes through the rest of the pipeline:
0 commit comments