Aha! Develop | Debug an extension
The debugging process is different for browser versus server extensions. Browser contributions can take advantage of the debugging features in the browser. For server extensions, Aha! Develop provides a number of features to improve observability into the extension running process.
Click any of the following links to skip ahead:
Debug browser contributions
The aha
API object is available on the window object in the browser. This means that it can be used directly from the developer console. This can be helpful for experimenting with the API or causing actions to occur immediately.
An event can be triggered from the browser directly using:
aha.trigger("aha-develop.github.pr.labeled",
{
record: new aha.models.Feature({ id: "PLAT-3" }),
label: { name: "Shipped" }
}
)
A command can be initiated like:
aha.command("aha-develop.github.sync")
It is also possible to use the model API directly, which can be helpful when troubleshooting queries, such as:
feature = new aha.models.Feature({ referenceNum: "PLAT-123" })
await feature.getExtensionFields("aha-develop.github")
Debug server contributions
Debugging server contributions is primarily done using console.log()
to log-observe the behavior of the running code. Being able to quickly invoke the same code many times and make small tweaks makes the process bearable. The logs for each invocation of a server extension contribution are visible in the Aha! Develop UI by navigating to Settings ⚙️ Account Extensions.
The logs can also be live-tailed using the CLI:
aha extension:tail