Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Developer Documentation

Core edited this page Oct 24, 2021 · 10 revisions

Interacting with our electron-store instance

From the main process

app.cfg.get(item[, defaultValue])

  • item String - The value you want to get from the config
  • defaultValue Bool (Optional) - Gets the default value of an item if the config doesn't exist

Fetches a value from the configuration.


app.cfg.set(key, value)

  • key String - The configuration value you are aiming to change (I.e. general.discordRPC)
  • value Any - The value you wish to set the config value to. (Must be JSON serializable)

Sets a value from the electron-store configuration.


app.cfg.store Fetches the entire electron-store configuration


Read more about what you can do by reading the electron-store documentation.

From the renderer process

ipcRenderer.invoke('getStoreValue', item, defaultValue)

  • item String - The value you want to get from the config
  • defaultValue Bool (Optional) - Gets the default value of an item if the config doesn't exist

Fetches a value from the configuration.


ipcRenderer.invoke('setStoreValue', key, value)

  • key String - The configuration value you are aiming to change (I.e. general.discordRPC)
  • value Any - The value you wish to set the config value to. (Must be JSON serializable)

Sets a configuration value


ipcRenderer.sendSync('getStore')

Fetches the entire electron-store configuration.


ipcRenderer.sendSync('setStore', store)

  • store Object - The updated store that you want to set the electron-store configuration to
Clone this wiki locally