In earlier Office integration solutions, we were using COM or VSTO add-ins that run only on Office for Windows. In our VSTO add-in for WORD we were using SQLite database to store some values that we could change in future. Now we want to re-write that Add-in using Office.js for WORD. Question: Can we store a value in Office.js Add-in for a later use, or are there any alternatives for it such as storing in XML or Json
etc? The major difference what you see is that COM Add-ins were running in the user device or in the Office Client; whereas, the new Office Add-ins don't involve code that runs on the user's device or in the Office client.
There are several options for storing data in add-ins. You can create custom XML and store it in the document and you can create custom settings that you store in the document. A JSON string can be the value of a custom setting. See this article for details: Persisting add-in state and settings.
In addition, you can use SessionStorage for data that doesn't need to survive the session. You can use LocalStorage to store info on the machine (instead of the document). Also, you can have a backend data storage in your web application; for example, an Azure SQL database, firebase, MongoDB, etc.