TelemetryDeck / SwiftSDK

Swift SDK for TelemetryDeck, a privacy-conscious analytics service for apps and websites.
https://telemetrydeck.com/
Other
149 stars 31 forks source link

Add support for usage through Server Side Swift #20

Closed Jeehut closed 1 year ago

Jeehut commented 3 years ago

I just tried to setup TelemetryDeck on the Server (using Vapor) to track some anonymized events of my users API endpoint actions. One reason for this is that I take privacy seriously and therefore don't want to include any library that automatically accesses environment data if I can avoid it. This library for sure does that, so my preferred way to use TelemetryDeck is on the server side, where the environment doesn't provide any user-specific information. I already found out that I can set a user identifier manually, and I saw in the code that any additional payload fields can also override the ones automatically set. This way I will be able to control what data is being tracked of my users and to also implement Differential Privacy on my server if needed (as Telemetry doesn't support that yet).

But even with all these manual actions, this library seems still not to be prepared for Server-side usage as it's not only failing to recognize Linux as a platform automatically, but is also using DispatchQueue for doing asynchronous network calls, which I think is not the right way to go for a Vapor app. I'd expect some setting to run the network requests in an EventLoop instead (using Swift NIO).

@winsmith Do you have plans to add proper support for usage from the Server side? Or is this only intended for app clients?

winsmith commented 3 years ago

Hi Jeehut, these are all good points. I do intend to support server side telemetry as well, but it's not as high on my list of priorities as getting the desktop and mobile apps to a certain level of quality. I'll get around to it at some point, but if you want something quicker, you can totally fork this repo and use your own changes, or write a small library that implements the spec. I'll be happy to answer all your questions

Sherlouk commented 2 years ago

I have just published a Vapor package which adds support for TelemetryDeck signals: https://github.com/getsidetrack/vapor-telemetrydeck

It's fairly basic for now, but should have the essentials. Happy for you to raise feature requests via issues if you have extra requirements.

Let me know if this helps @Jeehut

winsmith commented 2 years ago

This is amazing and I love it! <3 Thank you

winsmith commented 1 year ago

Since @Sherlouk's package exists and works really well, I'm closing this ticket.