segmentio / typewriter

Type safety + intellisense for your Segment analytics
https://segment.com/docs/protocols/typewriter/
MIT License
228 stars 53 forks source link

Kotlin Multiplatform support #237

Closed alexsullivan-pi closed 2 years ago

alexsullivan-pi commented 2 years ago

First of all I want to start off by saying I LOVE this feature. I think it's absolutely brilliant and I'm super excited to see it push analytics forward!

I've got a (probably very complicated) feature request:

I'm currently working on a project that uses Kotlin Multiplatform. I know that Segment isn't natively supported in KM, but it would be really cool if there was some way to generate just the types for the analytic events (in Kotlin), without actually sending the event. Then we could offload sending the actual analytic to the native Segment libraries in Android, iOS and the web and just use the type safety to ensure we're building the right event payloads.

Anyways, just a thought and I love the library!

oscb commented 2 years ago

In v8 this is now possible! It supports both segment-kotlin but also does exactly what you mention, exporting kotlin types without client code when you select the option types only during init