You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are many ways of setting up an Electron app. While our recommended setup should work on any modern setup, it may fail to work on older versions of Electron.
If the recommended setup doesn't work for you, try this:
Install
Install the SDK using your preferred JavaScript package manager
npm add @aptabase/electron
Main Setup
On your main script, initialize the SDK before the app is ready:
const{ initialize }=require("@aptabase/electron");initialize("<YOUR_APP_KEY>");// 👈 this is where you enter your App Keyapp.whenReady().then(()=>{// ... the rest of your app initialization code});
Preload Setup
On your preload script, expose trackEvent on your window object.
You can use contextBridge if that's supported on your electron version.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
There are many ways of setting up an Electron app. While our recommended setup should work on any modern setup, it may fail to work on older versions of Electron.
If the recommended setup doesn't work for you, try this:
Install
Install the SDK using your preferred JavaScript package manager
Main Setup
On your
main
script, initialize the SDK before the app is ready:Preload Setup
On your
preload
script, expose trackEvent on your window object.You can use
contextBridge
if that's supported on your electron version.Alternatively, if it doesn't, you can expose it directly on the window object
Usage
You can now trackEvents from your
main
process by using the@aptabase/electron
:In your client code, use the window object:
Beta Was this translation helpful? Give feedback.
All reactions