Skip to main content

Hey everybody,

 

I was wondering what would be the best way to use Segment within a CLI tool. Should we directly embed the write-key and send data to Segment or should we use a proxy service which then redirects the data to Segment?

How do we protect against abuse? Everybody can just extract the write-key and spam anonymous_ids to exhaust our MTUs. 

 

Best,

Max

Hey Max,

We have some information about exposing write keys in our docs. You can check that out here. A new write key can be generated directly in Segment if you detect any bad actors.

If you are worried about exposing the write key, it may be best to look into implementation using a server-side integration such as our HTTP Tracking API, or other libraries. In essence, collecting the data and making any determinations on bad actors before sending data to Segment. This will remove the real-time element of a client-side integration, but will allow you to hide the write key.

Hopefully this info is useful and feel free to drop a reply if you have any questions.

Cheers!


Reply