Uploaded image for project: 'Konflux UI'
  1. Konflux UI
  2. KFLUXUI-1048

Add Analytics Runtime Configuration

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • None

      Acceptance Criteria

      • Add @segment/analytics-next package to konflux-ui
      • Add types to window.KONFLUX_RUNTIME includes ANALYTICS_ENABLED, ANALYTICS_WRITE_KEY, and ANALYTICS_API_URL fields.
      • Type definition in @types/index.d.ts is updated to declare all three new fields.
      • public/runtime-config.js provides local development defaults (ANALYTICS_ENABLED: 'false', empty key and URL).
      • A loadAnalyticsConfig() function reads from KONFLUX_RUNTIME and returns a typed config object.
      • Unit tests verify: config loading with all fields set, fallback defaults when fields are missing, and disabled state when ANALYTICS_ENABLED is 'false' or ANALYTICS_WRITE_KEY is empty.

      Notes

      • Follow the existing MONITORING_* naming pattern — prefix all fields with ANALYTICS_.
      • loadAnalyticsConfig() should live in src/analytics/load-config.ts, mirroring src/monitoring/load-config.ts.
      • The function should use the same parseBoolean helper already used by monitoring config.

              rh-ee-mtakac Milan Takac
              sbudhwar-1 Sahil Budhwar
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: