segmentio / analytics-node

The hassle-free way to integrate analytics into any node application.

Home Page:https://segment.com/libraries/node

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support middleware functions

Mihailoff opened this issue · comments

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

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

Could you explain what is your issue, please?

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

Would using a source middleware read this documentation, please

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

@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.

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.

@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