Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Helicone Helicone Feature Definitions

From Leeroopedia
Revision as of 12:56, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Helicone_Helicone_Feature_Definitions.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains Access Control, Feature Gating
Last Updated 2026-02-14 06:32 GMT

Overview

Central registry of features and subfeatures used for plan-based access control, providing type definitions, type guards, and display name mappings.

Description

This module defines the canonical list of features and subfeatures in the Helicone platform, categorized into two groups:

Addon Features (ADDON_FEATURES): Features that can be individually purchased as add-ons:

  • evals - Evaluators
  • experiments - Experiments
  • prompts - Prompts

Non-Free Features (NON_FREE_FEATURES): Features only available on paid plans:

  • sessions - Sessions
  • properties - Properties
  • users - Users
  • datasets - Datasets
  • alerts - Alerts

Each feature can have subfeatures defined in the SUBFEATURES mapping:

  • prompts: versions, runs, playground_runs
  • experiments: test_cases, variants
  • evals: runs
  • datasets: requests

The module also provides type guard functions (isFeature, isSubfeature), a helper to get subfeatures for a specific feature (getSubfeaturesForFeature), and display name lookup tables for both features and subfeatures.

Usage

Use these definitions when implementing feature gating logic, rendering feature names in the UI, or checking whether a string identifier corresponds to a valid feature or subfeature.

Code Reference

Source Location

Signature

export const ADDON_FEATURES: readonly ["evals", "experiments", "prompts"];
export const NON_FREE_FEATURES: readonly ["sessions", "properties", "users", "datasets", "alerts"];

export type FeatureId = (typeof ADDON_FEATURES)[number] | (typeof NON_FREE_FEATURES)[number];
export type SubfeatureId = /* union of all subfeature strings */;

export function isFeature(feature: string): feature is FeatureId;
export function isSubfeature(subfeature: string): subfeature is SubfeatureId;
export function getSubfeaturesForFeature(feature: FeatureId): readonly string[];

export const FEATURE_DISPLAY_NAMES: Record<FeatureId, string>;
export const SUBFEATURE_DISPLAY_NAMES: Record<SubfeatureId, string>;

Import

import {
  ADDON_FEATURES,
  NON_FREE_FEATURES,
  FeatureId,
  SubfeatureId,
  isFeature,
  isSubfeature,
  getSubfeaturesForFeature,
  FEATURE_DISPLAY_NAMES,
  SUBFEATURE_DISPLAY_NAMES,
} from "@/lib/features";

I/O Contract

Feature Registry

Feature ID Category Display Name Subfeatures
evals Addon Evaluators runs
experiments Addon Experiments test_cases, variants
prompts Addon Prompts versions, runs, playground_runs
sessions Non-Free Sessions (none)
properties Non-Free Properties (none)
users Non-Free Users (none)
datasets Non-Free Datasets requests
alerts Non-Free Alerts (none)

Type Guard Functions

Function Input Output Description
isFeature string boolean Returns true if the string is a valid FeatureId
isSubfeature string boolean Returns true if the string is a valid SubfeatureId
getSubfeaturesForFeature FeatureId readonly string[] Returns subfeature IDs for the given feature, or empty array

Usage Examples

import { isFeature, FEATURE_DISPLAY_NAMES, getSubfeaturesForFeature } from "@/lib/features";

// Type guard usage
const featureId = "prompts";
if (isFeature(featureId)) {
  console.log(FEATURE_DISPLAY_NAMES[featureId]); // "Prompts"
  const subs = getSubfeaturesForFeature(featureId);
  // ["versions", "runs", "playground_runs"]
}

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment