Skip to main content

Migrating from the v1 API the v2 API

Upgrade the node module to get started:

npm install debugbear@latest -g


No action is required if you signed up after August 15 2019.

If you signed up before that date you'll need to add the --inferBuildInfo flag to maintain the same behavior. This will auto-detect values like the branch name and commit title.

Node API

Previously the API key was inferred from the environment. Now you need to instantiate an API client and pass the API key to it:

const { DebugBear } = require("debugbear")
const debugbear = new DebugBear(process.env.DEBUGBEAR_API_KEY);

If you currently trigger page tests like this:

pageId: 185,
commitHash: "e2ba122",
waitForResult: true

Then you need to change it to this:

const analysis = await debugbear.pages.analyze(185, { commitHash: "e2ba122" });
await analysis.waitForResult();