In order to achieve this, you'll require a server or a service. Setting up your own server demands a physical machine and significant effort for upkeep, which is why opting for a service may be more suitable.
One of the finest services I've come across, offering free access with restricted bandwidth, is Firebase. It functions as a database service, allowing you to store data just like you would locally using local or session storage methods. If your project expands significantly and begins consuming substantial bandwidth, you may need to consider paid options. Nevertheless, keep in mind that server maintenance also incurs costs.