segmentio / analytics-kotlin

The hassle-free way to add Segment analytics to your Kotlin app (Android/JVM).

Repository from Github https://github.comsegmentio/analytics-kotlinRepository from Github https://github.comsegmentio/analytics-kotlin

Question: Is it supported multiple instance write key?

guiihlopes opened this issue · comments

Hi, I would like to know if it's supported multiple instances with different write keys.

Currently I'm working in a single project application which has multiple contexts. Some of these contexts should send informations to worskpace1 and others to workspace2. And I couldn't find in the docs what the best practice should be to deal with this situation.

The only information I've found about this topic is for analytics-ios. And it still in a confused way, because there's two different information in each side:

image
Source: https://segment.com/docs/connections/sources/catalog/libraries/mobile/apple/

image
Source: https://segment.com/docs/connections/sources/catalog/libraries/mobile/ios/ios-faqs/

How could I handle this scenario which I need to split the sent informations based in a context?

hi @guiihlopes, yes, analytics-kotlin supports multiple instances. to sent information to different workspaces, simply creates multiple analytics instance with different writeKeys.