Electron Installation
Use this doc to install Heap on Electron apps. For web installation instructions, see our web installation guide. Electron doesn't natively support cookies, so Heap's Classic JavaScript web snippet won't work out-of-the-box.
Core SDK
Heap's Core SDK only needs two options set to work with Electron.
We recommend you set the eventPropertiesStorage
and metadataStorage
options to localStorage
. To learn more, see Advanced Configuration.
Classic SDK
We've created a fork of the electron-cookies
package that allows Heap to function within Electron apps, if you'd like to give it a try, it's available in our Github. To use the forked electron-cookies
package in your Electron app, add it to your package.json
dependencies like so:
{
"dependencies": {
"electron-cookies": "heap/electron-cookies"
}
}
After you npm install
the package, you should be able to add require('electron-cookies');
to your application’s renderer.js
, and include the web snippet above in your application’s HTML.
If your application has nodeIntegration: false
in its configuration (this is the most common setup), instead of adding require('electron-cookies');
include the following script tag to your application’s HTML after running npm install:
<script src='./node_modules/electron-cookies/dist/electron-cookies.js'></script>
Updated 7 days ago