In my old legacy realm cloud application, I was using a method where I would have a local realm when a user first starting using the app.
Eventually, if they decide to start paying for sync, I would migrate that realm to a synced realm.
I’m working on migrating my app to MongoDB Realm from Realm Cloud currently (this is a react-native app).
My thought is that instead of doing this difficult client side migration when a user toggles sync on/off, that I could just start off with an anonymous user so that there is only ever one schema / one type of Realm.
Then, if they pay for syncing later, I can create a JWT login to gate access to authenticate the user and then use that on new devices to link to the same data set.
I’m just wondering if there is any example of how to do this? Does creating a login automatically use the previous anonymous user’s realm user? Are there any drawbacks? I also read somewhere that the anonymous user isn’t permanent and data may be lost, which is obviously not usable in production.
Would love to hear how anyone else is solving this issue.