After reading Electron's security tutorial, I disabled nodeIntegeration and enabled contextIsolation when creating my instance of BrowserWindow. This has the effect that the renderer cannot load modules that depend on NodeJS APIs (such as require()). So, for example, I am unable to use electron-store (or electron for that matter).
This also means that I am unable to use IPC, even though I wouldn't be able to use IPC anyway because it JSON serializes my custom objects, which essentially causes object slicing by converting my custom object into a POJO.
With that said, what is the correct way to securely communicate between the main process and the renderer process. I want to create a Singleton app instance in my main process, access it in the renderer process (e.g., load configuration from disk, and then allow the user to view/edit it from the renderer, save the changes back to disk) as securely as possible.
I have looked at some other similar topics (e.g., like this one) and it still doesn't work; besides, even if it worked, it's a hack and I'd like to avoid hacks if there are better ways that I'm just not finding on my own.