Configuration options
Configure the Web SDK with customization options for UI and also tweak settings to control its behavior programmatically.
Last updated
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- CDN Loading Script: Put this in the HTML head tag -->
<script src="https://cdn.betterbugs.io/scripts/latest/index.js"></script>
<!-- Initialize the SDK -->
<script>
const startBB = function () {
if (window.Betterbugs) {
new window.Betterbugs({
// Replace with your BetterBugs Project API key
apiKey: "YOUR-API-KEY-GOES-HERE",
mode: "production",
position: { top: "20px", right: "20px" },
styles: {
primaryColor: "#e41c38",
primaryTextColor: "#fff",
theme: "light",
},
successMessageHeaderText: "Thank you! 🙏🏻",
successMessageSubHeaderText: "Your feedback is submitted.",
metaData: { username: "obi wan", plan: "individual", userID: 1234 },
email: "obi@example.com",
});
}
};
startBB();
</script>
<title>BetterBugs Web SDK Widget | JavaScript + CDN</title>
</head>
<body>
<h2>BetterBugs Web SDK Widget | JavaScript + CDN</h2>
<p>The button 👇🏻 will throw a random error in console</p>
<button class="btn">Click here</button>
<p>BetterBugs catches the error</p>
<script>
document.querySelector(".btn").addEventListener("click", function () {
throw new Error(`Random Error: ${Math.trunc(Math.random() * 10) + 1}`);
});
</script>
</body>
</html>