RealmJS structuring App

Can you please guide/Suggest handling the below use case in my App?

  1. Free users can create 5 categories Without login in offline mobile storage
  2. After login user (Ex:, 5 categories can be sync
  3. Now the user logout/Using another device and created 5 categories (without login)
  4. Now the user login again using the existing previous mail id (Ex: and new categories will start sync. already 5 categories are on the server. Now the user will have 10 categories in his account, Which is not allowed.