Defult home directory for snap installer

I’m currently building a electron app an building the installer like .deb and .snap with electron-builder. Inside the app I need the access the user home directory for some reason and I’m using process.env.HOME || process.env.USERPROFILE to get the home directory (also app.getPath('home') returns the same). This works properly for other cases but when the app installed with .snap instead of the actual home(~/) directory this returns ~/snap/<app_name>/3/ as home directory.
How do I get the actual home directory for all cases?