0

We have a React Native app and we are logging to App Insights using the "applicationinsights-react-native package", this all works fine in a sense, but we are trying to start using the monitoring side of things which uses a User ID. Now I'm pretty sure that whatever the User ID that the (app insights) package is using for a user ID won't cause too many problems if we kept it, but it won't be right.

The ApplicationInsights class has a setAuthenticatedUserContext method, however the comments seem to refer to cookies suggesting it's a React package re-purposed and this GitHub post https://github.com/microsoft/appcenter-sdk-react-native/issues/503 suggests we can't use it, however the response is for the React Natve AppCenter package which we are not using. We are using App Insights direct.

So I was wondering if there was a way to set our user_Id/User context if we are using App Insights directly from a React Native app?

Rich Shepard
  • 347
  • 2
  • 7

1 Answers1

0

It looks like setAuthenticatedUserContext does work if you talk to App Insights directly and not theough Appcenter, it's possible that it works through Appcenter now as well, I have not tested so I am not sure.

If you want to check that this ends up as on the App Insighst side, it appears as a property called user_AuthenticatedId.

Rich Shepard
  • 347
  • 2
  • 7