-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Is analytics-next
officially supported?
#259
Comments
Hi, I also have this same question. We're currently using the |
Hello, same problem here, types are incompatible for |
Hello, also curious here - is this currently supported? |
Hi, we are also looking to implement Typewriter but cannot see an obvious way to do it with our current implementation of |
After digging into this more I found that it seems possible to get typewriter to play nice with analytics-next. The blocker was that the default analytics used by typewriter is window.analytics which is not available when using analytics-next. Thankfully, you can set the analytics object to use yourself using setTypewriterOptions.
From here all of your tracking events should work. The only caveat is that the analytics types are not the same (typewriter uses SegmentAnalytics.AnalyticsJS and analytics-next uses AnalyticsBrowser. So far I have just silenced the compiler/linter and it seems to work ok. It would definitely be a lot better if there was first class support for analytics-next to avoid having to hack around the types in this way though - I can't have confidence that this won't break in future. |
Yeah it seems there are types conflict between the generated The |
|
@silesky What minimum version of analytics-next is compatible with typewriter v9? We've used v1.38.0 previously, and when upgrading to the most recent v1.57.1, we found out that events were not sent to segment anymore (but only in production for some reasons) and it's been hard to debug this so we rollback to our previous version for now. (And btw, if you have an idea what could be the problem, I'd appreciate it a lot!) The generated file uses an |
@tleunen I think 1.43.1? There were significant API enhancements around 1.38. You might want to take another look at the updated README and follow the recommended way for instantiating analytics, since that has changed -- we support a synchronous API out of the box, which improves event reliability. Also directions for logging initialization errors. |
I noticed this lib has a dependency on
window.analytics
and@types/segment-analytics
and so I'm wondering if this library has been tested against the neweranalytics-next
lib for Segment?The text was updated successfully, but these errors were encountered: