Skip to main content

API updates: TypeScript typings, custom headers, and access build results

ยท One min read

The DebugBear API has been extended and the node module now exports TypeScript types.

We've published a new version of the Node API. Here's an example of what you can do with it:

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

const analysis = await debugbear.pages.analyze(pageId, {
// Commit Hash is required to generate a build
commitHash: "abc123",
customHeaders: {
"X-Enable-Experiment": "true"
},
})
const result = await analysis.waitForResult()
console.log(result.build.status) // "success"

Check out the migration guide if you're moving from version 1 of the API.

Get a monthly email with page speed tips