TagoIO SDK for JavaScript and TypeScript
    Preparing search index...

    Class Dashboards

    Index

    Constructors

    Properties

    widgets: Widgets = ...

    Methods

    • Deletes a dashboard from the application.

      Parameters

      • dashboardID: string

      Returns Promise<string>

      If receive an error "Authorization Denied", check policy Dashboard / Delete in Access Management.

      const result = await Resources.dashboards.delete("dashboard-id-123");
      console.log(result); // Successfully Removed
    • Creates a copy of an existing dashboard.

      Parameters

      • dashboardID: string
      • OptionaldashboardObj: { new_label?: string; setup?: object }

      Returns Promise<{ dashboard_id: string; message: string }>

      If receive an error "Authorization Denied", check policy Dashboard / Duplicate in Access Management.

      const result = await Resources.dashboards.duplicate("dashboard-id-123", { new_label: "Copy of My Dashboard" });
      console.log(result);
    • Builds or edits an AI dashboard from a prompt. Without run_user, it changes the dashboard's own setup. With run_user, it changes that run user's individual dashboard, which requires per_user on the dashboard.

      A generation takes 15 to 60 seconds, so this call waits up to 180 seconds. The server answers 429 when the profile already runs 3 generations or the dashboard is already generating.

      Each generation is billed and saves a new dashboard version, so the SDK makes a single attempt and never retries it, even after a timeout or a 5xx. Callers decide whether to call again.

      Parameters

      Returns Promise<{ id: string }>

      If receive an error "Authorization Denied", check policy Dashboard / Edit in Access Management.

      const result = await Resources.dashboards.generate("dashboard-id-123", {
      prompt: "Show temperature and humidity for the last 24 hours",
      history: [
      { role: "user", content: "Add a map of all sensors" },
      { role: "assistant", content: "Added a map widget with every sensor." },
      ],
      run_user: "run-user-id-123",
      });
      console.log(result); // { id: 'dashboard-id-123' }