If receive an error "Authorization Denied", check policy Dashboard / Delete and Edit in Access Management.
const result = await Resources.dashboards.widgets.delete("dashboard-id-123", "widget-id-456");
console.log(result); // Successfully Removed
// To remove sizes from all widgets from a dashboard
// Before running this, make sure doesn't have more widgets in the dashboard.
await Resources.dashboards.edit("dashboard-id-123", { arrangement: [] });
Optional
options: EditResourceOptionsOptional
params: GetDataModelconst resources = new Resources({ token: "YOUR-PROFILE-TOKEN" });
const result = await resources.dashboards.widgets.getData("dashboard-id-123", "widget-id-456", {
start_date: "2025-01-01",
end_date: "2025-12-31",
timezone: "UTC"
});
console.log(result); // { widget: { analysis_run: null, dashboard: '6791456f8b726c0009adccec', ... }, ...}
Description
Creates a new widget for a specified dashboard with the given configuration.
Example
If receive an error "Authorization Denied", check policy Dashboard / Create and Edit in Access Management.