Skip to content

Commit 3089762

Browse files
authored
Merge pull request #4521 from segmentio/fix-addDestinationMiddleware-example
Fix addDestinationMiddleware example in docs
2 parents a18d64f + 0319911 commit 3089762

File tree

1 file changed

+3
-3
lines changed
  • src/connections/sources/catalog/libraries/website/javascript

1 file changed

+3
-3
lines changed

src/connections/sources/catalog/libraries/website/javascript/middleware.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Analytics.js can be extended using two functions:
1010

1111
```js
1212
addSourceMiddleware(middleware)
13-
addDestinationMiddleware(targetIntegration, [middleware1, middleware2, ...])
13+
addDestinationMiddleware(targetIntegration, middleware1, middleware2, ...)
1414
```
1515

1616
The first function (Source Middleware) allows you to manipulate the payload and filter events on a per-source basis, while the second function (Destination Middleware) allows this on a per destination basis. Middlewares run in the browser.
@@ -65,13 +65,13 @@ The above defined Source & Destination Middleware can be added to the Analytics.
6565

6666
```js
6767
analytics.addSourceMiddleware(SMW1);
68-
analytics.addDestinationMiddleware('integrationA', [DMW1]);
68+
analytics.addDestinationMiddleware('integrationA', DMW1);
6969
```
7070

7171

7272
You can call the `.addSourceMiddleware(fn)` multiple times, and the order of operations reflects the order in which you register your Source Middleware.
7373

74-
Both `.addSourceMiddleware(fn)` and `.addDestinationMiddleware('integration', [fn, ...])` can be called before [`.load()`](/docs/connections/sources/catalog/libraries/website/javascript/#load-options).
74+
Both `.addSourceMiddleware(fn)` and `.addDestinationMiddleware('integration', fn, ...)` can be called before [`.load()`](/docs/connections/sources/catalog/libraries/website/javascript/#load-options).
7575

7676
## Braze Middleware
7777

0 commit comments

Comments
 (0)