> ## Documentation Index
> Fetch the complete documentation index at: https://docs.molesignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# RUM feature flags

> See which feature flags sessions met, and compare how the sessions of each value did.

Tell the SDK what a flag evaluated to, and every event of the view carries it:

```ts theme={null}
molesignalRum.addFeatureFlagEvaluation('checkout_v2', 'treatment');
```

To follow a flag service, hand it the evaluations. LaunchDarkly has inspectors, and OpenFeature has hooks:

```ts theme={null}
LDClient.initialize(id, user, {
  inspectors: [{
    type: 'flag-used',
    name: 'molesignal',
    method: (key, detail) => molesignalRum.addFeatureFlagEvaluation(key, detail.value),
  }],
});

OpenFeature.addHooks({
  after: (context, details) => molesignalRum.addFeatureFlagEvaluation(context.flagKey, details.value),
});
```

## The feature flags tab

**Feature flags** lists the flags sessions evaluated in the range, the one most sessions met first. Choose one to compare its values side by side: sessions, the share of views with an error and with a sign of frustration, and for a browser application the 75th percentile of LCP, INP, and CLS. The value with the most views with an error is in red. **See these views** opens them in the explorer.

## Ask of a flag anywhere

A flag is named like a column, as `feature_flags.<key>`, wherever the [explorer](https://docs.molesignal.com/en-US/rum/explorer.md) and the API take a field:

```text theme={null}
feature_flags.checkout_v2 = 'treatment' AND error.type = 'TypeError'
```

```http theme={null}
POST /api/v1/rum/aggregate
{ "type": "views", "measures": [{ "fn": "p75", "field": "view.performance.lcp.timestamp" }], "group_by": ["feature_flags.checkout_v2"] }
```

The same goes for the other keys of a JSON column: `context.<key>`, `usr.extra.<key>`, and `view.custom_timings.<key>`. `GET /api/v1/rum/keys` lists the keys there are.

In SQL, read a key with `json_text("feature_flags", 'checkout_v2')`, which is text, or NULL for a key the row does not have. `json_keys("feature_flags")` lists the keys of a row.

## Mole Agent

The tool `get_rum_feature_flags` lists the flags, and with `flag` compares its values with the same numbers.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.