Implementation:Helicone Helicone Feature Definitions
| 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- Evaluatorsexperiments- Experimentsprompts- Prompts
Non-Free Features (NON_FREE_FEATURES): Features only available on paid plans:
sessions- Sessionsproperties- Propertiesusers- Usersdatasets- Datasetsalerts- 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
- Repository: Helicone
- File: web/lib/features.ts
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"]
}