Electron app example
Quick installation guide to setup the BetterBugs Web SDK widget for your Electron applications.
How to install BetterBugs Web SDK in Electron apps
2
3
Configure Electron app for BetterBugs SDK: Add the following code to TypeScript src/main.ts file
import { app, BrowserWindow, session, desktopCapturer } from "electron";
// Wait for the app to be ready before creating the window
app.whenReady().then(() => {
// Configure session before creating window
session.defaultSession.setDisplayMediaRequestHandler(
(request, callback) => {
desktopCapturer.getSources({ types: ["screen"] }).then((sources) => {
callback({ video: sources[0], audio: "loopback" });
});
},
{ useSystemPicker: false }
);
createWindow();
});
function createWindow() {
const mainWindow = new BrowserWindow();
// Load the index.html file
mainWindow.loadFile("index.html");
mainWindow.setFullScreen(true);
}4
5
Customize the SDK widget UI (Optional)
<!-- BetterBugs SDK initialization -->
<script>
document.addEventListener("DOMContentLoaded", () => {
window.bb = new Betterbugs({
// Replace with your BetterBugs Project API Key
apiKey: "YOUR-API-KEY-GOES-HERE",
// UI Customization Examples
position: { top: "20px", right: "20px" },
styles: {
primaryColor: "#e41c38",
primaryTextColor: "#fff",
theme: "light",
},
});
});
</script>
Last updated