Switch from anonymous user to authenticated



My app paradigm is to allow users to access basic features anonymously and only require account creation to access premium features. Thus, every user starts out accessing Realm anonymously and can choose to create an account whenever the time is right for them.

Per this GitHub issue: https://github.com/realm/realm-js/issues/2211, there is no way to convert an anonymous user to authenticated. What is the recommended way to migrate or switch a user from anonymous to authenticated.

In my scenario, anonymous access is read-only and only an authenticated user can ever create content if that makes a difference to the overall migration strategy.


If it’s read-only, then why don’t you use a local realm file for that?
If the user pays and makes content, then you can save it on a synced realm so it will be backed up.


I have global data that is changed often by backend data aggregators and I keep clients in sync with Realm Cloud. The core of this data will always be read-only, even for authenticated users, but premium users will be able to enrich the data with, comments, ratings, etc.

I am not sure how I should be managing the transition from the initial anonymous user to authenticated and ensure that authenticated users have uninterrupted syncing to the changing global data and also be able to make their contributions.