Identity, teams, and configuration
HyperDX uses a user and team boundary to control access to observability data and product setup. A user signs in through a browser session or an access key, belongs to one team, and uses that team’s connections, sources, query settings, and shared product resources. Browser-only preferences stay with the user’s browser, while team setup is persisted for the deployment and shared by its members.
Identity boundary
The identity model separates personal access from shared team state. The main relationships are:
| Concept | Purpose |
|---|---|
| User | Represents a person and their sign-in credentials. A user is linked to one team. |
| Team | Owns shared access rules, data setup, query settings, keys, and team-owned product resources. |
| Connection | Describes a ClickHouse or Prometheus-compatible server that a team can query. |
| Source | Describes how one telemetry kind is read from a connection. |
| User preference | Controls local display choices such as time format, time zone, color mode, search-result behavior, and font size. |
Access paths
The browser uses a session cookie after password login or registration. Private application routes require that session and resolve the current user’s team before they read or change team data. Programmatic routes can use a user bearer access key; the API attaches that key to a user and team so the request has the same identity boundary. See API services and background tasks for the wider route and service layout.
References: packages/…/api-app.ts• L59-65 packages/…/api-app.ts• L96-112 packages/…/auth.ts• L82-112
Authentication entrypoints
The public entrypoints decide whether a visitor should enter the product, create the first team, or sign in to an existing team. The landing page checks both the current session and whether the installation already has a team.
Registration and login flow
The registration and login flow creates a session that the rest of the application can use. In the normal hosted flow, the first password registration creates the first team and applies any configured defaults; later visitors are sent to login instead of creating another team.
The browser follows this path:
flowchart TD
A[Landing page] --> B{Authenticated?}
B -->|Yes| C[Search]
B -->|No| D{Team exists?}
D -->|No| E[Register]
D -->|Yes| F[Login]
E --> G[Create user and first team]
G --> H[Apply team defaults]
H --> C
F --> I[Create browser session]
I --> C
Password login uses the user’s email as its identity. The server restores the user from the session on later requests and sends failed or incomplete authentication back to the login page. Logout removes the browser session. Local app mode is a deliberate exception: it uses a synthetic local user and team and skips normal authentication for a single-container experience. See Deployment topology for the runtime modes that select this behavior.
References: packages/…/LandingPage.tsx• L8-29 packages/…/AuthPage.tsx• L29-68 packages/…/root.ts• L60-149 packages/…/passport.ts• L10-58 packages/…/auth.ts• L34-51
Authentication state
The app waits for the current-user and team checks before it chooses a protected destination. This prevents a slow session lookup from looking like an unauthenticated user and preserves the intended page when a protected request receives an unauthorized response.
References: packages/…/AuthLoadingBlocker.tsx• L6-37 packages/…/api.ts• L48-75 packages/…/api-app.ts• L59-64
Team membership
Team membership is an invitation-based workflow after the first team exists. A team member creates a pending invitation, shares its URL, and the recipient sets a password to create a user already linked to that team.
Invitation and join flow
The invitation flow keeps the team boundary on the server. The invitation records the destination email and team, and the join token is the only team reference presented to the recipient.
sequenceDiagram
participant M as Team member
participant A as API
participant R as Recipient
participant D as Product data store
M->>A: Create invitation
A->>D: Save team and email with token
A-->>M: Return join URL
M-->>R: Share join URL
R->>A: Set password with token
A->>D: Create user in invited team
A->>D: Remove pending invitation
A-->>R: Start session and open product
Pending invitations use a normalized email and expire after 30 days. An existing user cannot be invited through this flow, and a second pending invitation for the same email in the same team is not created. Team settings lists both active members and pending invitations so an administrator can remove a member or revoke an unused invitation. If an invitation was already removed, the settings UI treats a repeated delete as a no-op and refreshes the pending list.
References: packages/…/team.ts• L136-220 packages/…/root.ts• L151-204 packages/…/teamInvite.ts• L4-40 packages/…/TeamMembersSection.tsx• L23-174
Member removal
Removing a member deletes that user’s access to the team. Alert records remain team-scoped and can keep an optional creator link; the removal workflow reassigns alerts created by the removed user to the user who performs the removal so team-owned alert records do not keep a reference to a deleted creator.
References: packages/…/team.ts• L280-307 packages/…/user.ts• L31-55 packages/…/alert.ts• L79-94 packages/…/alert.ts• L195-203
User experience setup
User experience setup combines browser-local preferences with a setup checklist for new teams and product-use tasks for each user. Neither mechanism changes the team’s shared telemetry configuration.
User preferences
User preferences are stored in browser local storage under one user-preference record. They control time display, search-result behavior, and appearance for that browser, and they do not become team settings. The color mode can follow the operating system and is applied before the app renders to avoid a visible theme change.
| Preference group | User choices |
|---|---|
| Time | 12-hour or 24-hour display; local time or UTC |
| Search results | Open a side panel or expand a result inline when the row is clicked |
| Appearance | System, light, or dark color mode; content font size |
| Font | Supported interface fonts |
| Navigation | Optional expanded sidebar header state |
The brand theme is deployment configuration rather than a user choice in production. A development-only control can switch brand themes for local testing. Older preference records that use the former theme field are converted to the current color-mode shape. Invalid or unreadable records fall back to the default preferences.
References: packages/…/useUserPreferences.tsx• L6-28 packages/…/useUserPreferences.tsx• L77-159 packages/…/UserPreferencesModal.tsx• L71-253
Onboarding checklist
The onboarding checklist guides a new team through the minimum setup needed to query data. It first checks for a connection, a source, and data in the configured source tables. The connection and source steps open team settings, while the data step opens the product’s data-install guidance.
After setup, the checklist changes to per-user product tasks. These tasks guide the user to run a non-trivial search, build a dashboard, set up an alert, and connect the MCP server. Task completion is stored for the user, while the setup checks are derived from the current team configuration.
The checklist has two time windows. It shows setup work during the first three days of a team and product-use work until the team is seven days old when setup is complete. Users can collapse or dismiss it. Local mode does not show it because its synthetic identity cannot persist task or dismissal state. A short completion message appears only when the user finishes the visible phase during the current session.
This diagram shows how the checklist moves from shared team setup to personal product use.
flowchart TD
A[New team] --> B[Connection, source, and data checks]
B -->|Setup complete| C[Per-user product tasks]
C --> D[Search, dashboard, alert, and MCP tasks]
B -->|Setup incomplete| E[Team setup guidance]
Onboarding also helps a user connect an AI assistant to the team’s MCP service. The user selects a supported host and receives the install form that fits that host, such as a terminal command, an install link, or a JSON configuration block. Each form uses the user’s personal access key as bearer access to the same MCP endpoint, so the assistant acts within the user’s team boundary. See External interfaces and automation for the wider automation surface.
References: packages/…/OnboardingChecklist.tsx• L18-115 packages/…/onboardingTasks.ts• L5-54 packages/…/useOnboardingCompletion.ts• L35-110 packages/…/useOnboardingCompletion.ts• L112-251 packages/…/McpInstallPanel.tsx• L50-93 packages/…/installSnippets.ts• L34-53 packages/…/installSnippets.ts• L102-117
Data configuration
Connections and sources form the data setup that turns a team’s storage into queryable telemetry. A connection identifies the server; a source identifies the database and table, the telemetry kind, and the fields needed to interpret rows.
Connection configuration
Team members configure a named ClickHouse connection with a host and credentials. A connection can also represent a Prometheus-compatible endpoint when that feature is enabled; that mode is for PromQL and does not provide ClickHouse-backed logs, traces, or metrics. The UI can test ClickHouse credentials before saving and keeps an existing password when an edit does not include a new one.
Connections are team-scoped. The API checks the current team for every list, create, update, and delete operation, so a source cannot point to a connection owned by another team.
References: packages/…/ConnectionForm.tsx• L46-120 packages/…/ConnectionForm.tsx• L128-225 packages/…/connections.ts• L16-131 packages/…/types.ts• L1929-1943
Source configuration
A source is a saved description of one data view. It selects a telemetry kind and maps that kind to a connection, database, table, and field expressions. Supported kinds cover logs, traces, sessions, OpenTelemetry metrics, and PromQL. Sources can be enabled or disabled and can link related kinds, such as logs to traces or sessions to traces.
The saved source contract keeps the team and connection identity with common source data while allowing each telemetry kind to define its own view fields. Metric sources can use either kind-specific tables or the team’s enabled series-table setup. Metric and PromQL sources can also set a minimum auto-granularity floor for chart queries; when it is unset, the existing automatic behavior remains. This keeps the saved setup usable by search, charts, traces, sessions, and ingestion-related views. See Telemetry ingestion and storage for the storage path that these sources read.
When an engineer selects a table, the product can inspect its columns and suggest a source configuration. The source form validates the kind-specific fields before it saves, and the API validates the same shared contract while checking the connection belongs to the team.
References: packages/…/SourceForm.tsx• L74-217 packages/…/SourceForm.tsx• L576-767 packages/…/sources.ts• L21-126 packages/…/source.ts• L18-49 packages/…/source.ts• L84-125 packages/…/source.ts• L274-309 packages/…/types.ts• L1987-2215
Persisted product setup
Shared setup is persisted at the team boundary and is read by both the web app and server services. Deployment configuration can seed an empty team, while later edits through team settings become the team’s working configuration.
Team settings
Team settings provides the shared control plane for a deployment. Its areas cover data, members, access policy, API and agent access, integrations, and query settings. The team record also carries the keys and flags that connect team identity to collection and query behavior. The selected area is reflected in the page URL, which lets users return to a specific settings area without changing the team scope.
The query settings apply defaults such as row limits, query timeout, metadata reads, parallel query behavior, and filter-key limits. A null update removes a saved override so the underlying service default can apply again. The settings UI presents these as ClickHouse client controls and lets an administrator reset a custom value to its default. These settings are distinct from connection credentials and from browser preferences. Team-level tag discovery also combines tags from dashboards, saved searches, and alerts, so shared labels stay within the team boundary.
References: packages/…/TeamPage.tsx• L75-207 packages/…/TeamPage.tsx• L209-267 packages/…/TeamQueryConfigSection.tsx• L272-349 packages/…/team.ts• L36-133 packages/…/team.ts• L93-136 packages/…/team.ts• L15-55 packages/…/dashboard.ts• L7-15 packages/…/types.ts• L1945-1982
Alert webhooks
A webhook is a saved team integration that sends alert events to an external HTTP service. Team members can create or edit destinations for Slack, incident.io, or a generic service, then send a test event before the destination is used for alerts.
Non-Slack destinations can use a service-specific JSON body when the form is left blank. Their bodies support alert template variables such as the title, state, alert ID, status, value, source query, and deep link. The form checks non-Slack templates as the user edits them and shows a location-aware error for malformed template syntax. Slack uses a fixed payload and does not render the custom body. Generic destinations can also define custom JSON headers. When a user changes service type, an untouched default body is replaced with the new service’s default while a hand-edited body remains unchanged.
References: packages/…/WebhookForm.tsx• L40-84 packages/…/WebhookForm.tsx• L139-150 packages/…/WebhookForm.tsx• L152-213 packages/…/WebhookForm.tsx• L215-316 packages/…/WebhookBodyValidation.tsx• L5-27 packages/…/WebhookForm.test.tsx• L81-199
Terraform migration
Team settings can export selected team resources as a Terraform import file for the ClickHouse provider. The export covers dashboards, alerts, saved searches, sources, connections, and webhooks, with connections represented as reference-only locals because the platform manages them.
The export is a migration aid rather than a second source of team state. It reads a team-scoped resource manifest, lets the user choose resource types, and writes import addresses that Terraform can use to generate configuration. The interface reports resources that cannot be represented by the provider and warns when a capped listing makes the file partial. A download refetches the manifest so the file reflects current resources; fetch or build errors stop the download and remain visible to the user.
References: packages/…/IacMigrationSection.tsx• L29-62 packages/…/IacMigrationSection.tsx• L126-227 packages/…/IacMigrationSection.tsx• L230-327
Shared dashboards
Dashboards are team-owned saved views that combine visual tiles with saved query and filter state. They can carry tags and user history, while provisioned dashboards support stable team-level setup that can be managed outside the normal browser workflow. See Dashboards and visualization for how these saved views become user-facing charts.
Because dashboards are shared team resources, their listings and tag discovery use the team boundary. The model also keeps optional creator and updater links, which lets product actions retain useful user history without changing dashboard ownership.
References: packages/…/dashboard.ts• L7-15 packages/…/dashboard.ts• L19-65 packages/…/team.ts• L123-136
API and agent access
Team settings exposes two access keys with different scopes. The team ingestion API key belongs to shared team setup, while the personal API access key identifies one user for programmatic access. Users can copy either key and administrators can rotate the team key; a user can rotate the personal key.
Rotation revokes the old key at once. This affects clients that use that key, including MCP and AI agent setups, API clients, infrastructure tools, and CI scripts. It does not end the browser session. MCP onboarding turns the personal key and the deployment URL into host-specific setup for the team’s MCP endpoint. See External interfaces and automation for consumers of these keys.
References: packages/…/ApiKeysSection.tsx• L33-107 packages/…/ApiKeysSection.tsx• L109-158 packages/…/McpInstallPanel.tsx• L55-93 packages/…/installSnippets.ts• L97-117
Default setup
Default setup bootstraps an empty team from deployment-provided connection and source definitions. It creates connections first, resolves source connection names, creates the sources, and then resolves links between related sources. Existing connections or sources are left in place, so the bootstrap path does not overwrite an established team.
The same setup runs after first-team registration and during local app startup. In local mode, the browser can also load connection and source definitions from local session storage or public local defaults. This is the bridge between a fresh deployment and the first usable data view; deployment-specific environment wiring is described in Deployment topology.
References: packages/…/setupDefaults.ts• L18-48 packages/…/setupDefaults.ts• L83-103 packages/…/setupDefaults.ts• L105-232 packages/…/root.ts• L81-135 packages/…/server.ts• L93-111 packages/…/connection.ts• L10-53 packages/…/source.ts• L121-159
Change checklist
When these files or sections are changed, remember to consider these:
- Authentication route, redirect, or session changes must stay aligned between the landing-page decision, the browser login hook, and the API’s session middleware.
- User or team deletion changes must preserve team scoping and must account for shared records that refer to a user, such as alert creators.
- Invitation changes must preserve lower-case email matching, token expiry, join-token redirects, and the one-pending-invite-per-team/email rule.
- Connection schema changes must remain compatible with source connection checks and with password preservation during edits.
- Source-kind or source-field changes must update the shared source contract, table inference, source links, and the default-source bootstrap pass together.
- Source query-granularity changes must keep the metric and PromQL source contracts, saved model fields, form controls, and chart query behavior aligned. An empty value must continue to mean no floor.
- Team query-setting changes must update the shared team contract, persisted model fields, API update semantics, defaults, reset behavior, and the settings UI as one contract.
- Webhook changes must keep service-specific default bodies, template variables, template validation, URL rules, custom headers, test delivery, and edit behavior aligned.
- Dashboard changes must preserve team ownership, optional user history, provisioned setup identity, team-scoped listing, and tag discovery.
- Onboarding task changes must keep the task registry, display order, per-user completion state, phase windows, and destination links aligned. Changes to setup checks must preserve the team-data and local-mode rules.
- Terraform export changes must keep the resource registry, display order, manifest keys, provider limits, truncation notices, and fresh-download behavior aligned.
- Team or personal key changes must preserve the distinction between shared ingestion access and user-scoped programmatic access. MCP snippets and other external clients must continue to receive the right endpoint and bearer key.
- Default connection and source changes must preserve the creation order and name-to-ID resolution used when a new team is bootstrapped.
- Local-mode changes must keep browser session storage, synthetic identity, and server-side local defaults consistent.
- Preference changes must preserve migration from older stored shapes and the distinction between browser-local choices, deployment branding, and team configuration.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A visitor posts first-team registration after a team already exists | Registration returns a conflict and the visitor must use login | The installation check and server-side team-exists check gate registration |
| A session refers to a deleted user or a user without a team | The request is treated as unauthenticated or cannot enter the product | Session deserialization rejects missing users and protected routes require a non-null team |
| An invitation is older than 30 days, revoked, or has an invalid token | The recipient cannot create the invited account | Invitation expiry, scoped deletion, and token lookup constrain the join flow |
| A pending invitation is deleted before another delete request completes | The UI could report a misleading server error or show stale pending state | A team-scoped 404 is treated as an already-removed invite and the list is refetched |
| A source names a connection outside the current team | The source is rejected instead of crossing the team boundary | Source create and update validate the connection against the current team |
| A provisioned dashboard repeats a name within its team | The dashboard cannot satisfy the team’s stable provisioned identity | The dashboard model enforces the team/name uniqueness rule for provisioned dashboards |
| A webhook has an invalid URL or malformed custom headers | The destination cannot be saved or tested | Service-aware URL checks and JSON parsing stop the action and show an error |
| A non-Slack webhook body has malformed template syntax | The body cannot render the intended alert payload | Debounced template validation shows an inline error with the source location |
| A user changes a webhook service while its old default body remains | The destination can receive a body for the wrong service | The form clears an untouched old default and applies the selected service’s default |
| A key is rotated while an MCP, API, IaC, or CI client still uses it | That client receives 401 responses until it is updated | Rotation is explicit and warns that the old key is immediately revoked |
| Default sources are supplied without a usable default connection | The team starts with no bootstrapped sources | Bootstrap creates connections first and stops source creation when none are available |
| Browser preference data is malformed or uses an unknown shape | The interface uses default preferences | Preference migration validates stored data and falls back on parse or storage errors |
| A PromQL or metric source has an invalid minimum auto-granularity value | The source cannot satisfy the shared source contract or chart queries can use an unsafe floor | The shared source schema validates the value and the persisted source field maps an empty value to unset |
| The IaC resource manifest cannot load | The export could look like an empty team or produce a misleading file | The settings UI shows a load error and disables download |
| A resource changes after the manifest cache is read | Terraform receives stale or dangling import IDs | Download refetches the manifest and writes only after a successful refetch |
| A selected resource type is capped or contains provider-unsupported resources | The import file is partial or omits resources that the user expected | The UI marks truncated types and explains skipped resources before download |
Key files
| File | Why to read it |
|---|---|
| packages/…/LandingPage.tsx | Shows how the app chooses search, login, or registration at the public entrypoint. |
| packages/…/AuthPage.tsx | Shows the user-facing password registration and login forms. |
| packages/…/root.ts | Defines the server entrypoints for login, registration, logout, and invited-user setup. |
| packages/…/api-app.ts | Shows session setup and which application routes require an authenticated user. |
| packages/…/auth.ts | Defines session access, bearer-key access, team checks, and local-mode identity. |
| packages/…/team.ts | Defines team details, invitations, members, team name, and shared query settings. |
| packages/…/team.ts | Defines the team existence boundary, local team behavior, key rotation, query-setting updates, and team-wide tag discovery. |
| packages/…/TeamMembersSection.tsx | Shows the member and pending-invitation experience, including invite removal feedback. |
| packages/…/TeamPage.tsx | Maps team settings into the product’s shared configuration and access areas. |
| packages/…/TeamQueryConfigSection.tsx | Shows the team-level query controls, defaults, custom values, and reset behavior. |
| packages/…/WebhookForm.tsx | Shows how team members define alert destinations, service-specific bodies, headers, template variables, validation, and test delivery. |
| packages/…/WebhookBodyValidation.tsx | Shows the inline feedback used for malformed webhook body templates. |
| packages/…/WebhookForm.test.tsx | Protects the webhook service defaults, template-variable display, template validation, and service-change behavior. |
| packages/…/ApiKeysSection.tsx | Shows the difference between team ingestion keys and personal access keys, including rotation. |
| packages/…/useUserPreferences.tsx | Defines browser-local preference state and migration behavior. |
| packages/…/UserPreferencesModal.tsx | Shows the user-facing controls for time, search-result, appearance, font, and development-only brand settings. |
| packages/…/OnboardingChecklist.tsx | Shows the checklist presentation, phase summary, collapse behavior, and dismissal action. |
| packages/…/useOnboardingCompletion.ts | Defines the team setup checks, product-use phase, time windows, persistence rules, and completion behavior. |
| packages/…/onboardingTasks.ts | Defines the product task contract, order, destinations, and non-trivial search rule. |
| packages/…/McpInstallPanel.tsx | Shows how onboarding presents MCP setup for different AI assistant hosts. |
| packages/…/installSnippets.ts | Defines the shared endpoint and access-key shape used by MCP install options. |
| packages/…/connections.ts | Defines the team-scoped connection lifecycle. |
| packages/…/sources.ts | Defines the team-scoped source lifecycle and connection ownership check. |
| packages/…/source.ts | Defines the persisted source boundary, telemetry-specific source shapes, and minimum auto-granularity support for metric and PromQL sources. |
| packages/…/SourceForm.tsx | Shows the product model for source setup and related-source links. |
| packages/…/types.ts | Holds the shared contracts for teams, connections, and source kinds. |
| packages/…/setupDefaults.ts | Explains how empty teams receive deployment-provided setup. |
| packages/…/dashboard.ts | Defines team-owned dashboards, tags, user history, and provisioned dashboard identity. |
| packages/…/alert.ts | Defines team ownership and optional creator links for alert records affected by membership changes. |
| packages/…/IacMigrationSection.tsx | Shows how team resources are selected, checked, and exported as a Terraform import file. |
| packages/…/IacMigrationSection.test.tsx | Protects the resource registry, team-scoped import IDs, fresh manifest reads, and visible export failure states. |