title: Electron 'contextBridge'
body: <p>To provide suitable levels of security when loading remote content, it is stated that a <code>BrowserWindow</code>'s <code>contextIsolation</code> and <code>nodeIntegration</code> options must be enabled and disabled respectively. In this scenario, Node/Electron APIs will not be available to the main renderer process. In order to expose specific functionality, the window's preload script may exploit Electron's <code>contextBridge</code> feature, providing the main renderer with access to selected Node/Electron APIs.</p>
  
  <p>Despite information provided in the Electron docs, concrete examples of <code>contextBridge</code> usage are lacking overall. In general, existing documentation/tutorials do not focus on adopting secure practices when implementing an Electron app.</p>
  
  <p>The following is a single <code>contextBridge</code> usage example I've managed to find online: <a href="https://github.com/reZach/secure-electron-template" rel="noreferrer">https://github.com/reZach/secure-electron-template</a></p>
  
  <p>Would you be able to provide additional resources/examples which might be useful for the implementation of a secure Electron app (which relies on the <code>contextBridge</code> functionality)? </p>
  
  <p>Insight regarding <code>contextBridge</code> best practices is also highly appreciated.</p>