How to implement freemium

I want to have an app that is based on a freemium model. At start i want everybody to access with no logins then only users who wnat more functionalities will need to register. I am using the “optional sign-in”
mode for logins. I need to understand how to get users to register. is there a better way?

Maybe you can assign different roles for the users registered that have paid and for the ones registered that have not paid yet.
And then make the new features available to only the “premium” role.

So I assume you will show a checkout process to users who first sign in, so they can pay for more functionalities? What is your desired flow for signed-in users?