Start widget with npm or yarn
Quick installation guide to start the BetterBugs Web SDK widget with npm or yarn.
How to install the BetterBugs Web SDK widget using npm/yarn
Here are the steps for it:
1
Generate an API key from Project Settings
Log in to your BetterBugs dashboard and generate an API key from Project Settings. You’ll need it to initialize the SDK in the following steps.
2
3
Initialize the SDK (with default UI)
In your script file, import the SDK, create a BetterBugs instance from the import class, and initialize. Don’t forget to add your project API key in the function:
import { Betterbugs } from "@betterbugs/web-sdk";
const startBB = new Betterbugs({
// Replace with your BetterBugs project API key
apiKey: "YOUR-API-KEY-GOES-HERE",
});
startBB();
4
Customize the SDK widget UI (Optional)
You can customize the SDK with your brand colors and design from the initialization function:
import { Betterbugs } from "@betterbugs/web-sdk";
const startBB = new Betterbugs({
// Replace with your BetterBugs project API key
apiKey: "YOUR-API-KEY-GOES-HERE",
position: { top: "20px", right: "20px" },
styles: {
primaryColor: "#e41c38",
primaryTextColor: "#fff",
theme: "light",
},
});
startBB();
Last updated
Was this helpful?