Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Support middleware functions #348

Open
Mihailoff opened this issue Aug 3, 2022 · 8 comments
Open

Support middleware functions #348

Mihailoff opened this issue Aug 3, 2022 · 8 comments

Comments

@Mihailoff
Copy link

Browser library has a handy feature that allows using middleware functions.

https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/middleware/

@edsonjab
Copy link
Contributor

Could you explain what is your issue, please?

@Mihailoff
Copy link
Author

Filter events (or prevent tracking) dynamically based on the business rules.

@edsonjab
Copy link
Contributor

Would using a source middleware read this documentation, please

@Mihailoff
Copy link
Author

Server-side (analytics-node) is different from the source middleware that we use already. Not sure what you mean.

@nd4p90x
Copy link
Collaborator

nd4p90x commented Aug 15, 2022

@Mihailoff I believe there is some confusion as to exactly what the issue is you are having. Are you unable to filter events using your/our middleware solution? Are you describing a solution for another issue you may have had? I believe we just need some clarity on what the issue is exactly so we can better assist you in resolving it. Thank you.

@Mihailoff
Copy link
Author

The client (browser) library has middleware functionality, I thought it would be logical to port the same approach to the server side. My issue is that I need to filter events based on dynamic rules -- custom middleware is a perfect solution for it. Client and server are different data sources.

@pooyaj
Copy link
Contributor

pooyaj commented Aug 17, 2022

@Mihailoff We are working on Node runtime support with https://github.com/segmentio/analytics-next (AJS 2.0) ... so you can use analytics-next to instrument a node-js applications. AJS comes with a plugin architecture, so you can register plugins to modify the payload before they are sent to Segment. Will keep this issue updated as we release the Node support for AJS 2.0

@silesky
Copy link
Contributor

silesky commented Aug 17, 2023

Middleware support is in the new analytics node: https://github.com/segmentio/analytics-next/tree/master/packages/node

@segmentio segmentio deleted a comment from hamstu Aug 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants