sentry-java icon indicating copy to clipboard operation
sentry-java copied to clipboard

Sync User and Session data between Android/iOS SDKs and WebSDK

Open JohannesPtaszyk opened this issue 2 years ago • 4 comments

Problem Statement

In our apps we are using WebViews to provide some features dynamically. As we are using Sentry in Web and App, we would love to be able to sync the user and session data between the Web and Native SDKs.

Solution Brainstorm

It would be awesome if Sentry would provide some kind of JS bridge or other way of syncing the data between the SDKs in WebViews.

┆Issue is synchronized with this Jira Improvement by Unito

JohannesPtaszyk avatar Sep 13 '23 07:09 JohannesPtaszyk

Thanks for reaching out, that's an excellent idea! We'll look into this.

markushi avatar Sep 13 '23 13:09 markushi

In a first step let's have a manual method, something like Sentry.setupWebView(webview: WebView) In a later step we could have automatic code-instrumentation to auto-inject this into every WebView.

markushi avatar Sep 13 '23 13:09 markushi

As I prefere manual setup over automatic magic, I am totally fine! Thank you!

JohannesPtaszyk avatar Sep 13 '23 17:09 JohannesPtaszyk

We at Tapcart are also interested in a feature along these lines. Our scenario is:

  • We white label our app for multiple merchants
  • Those merchants can load custom content in Webviews via their own URLs
  • We would like a way to know when a specific URL + native screen (that contains a Webview) combination is exhibiting performance issues or causing errors. So, ideally, this would link native iOS SDK events with the Sentry JS SDK events if the Sentry JS SDK were present in the Javascript of the Webview.

micahnance avatar May 08 '24 16:05 micahnance