UNPKG

1.28 kBTypeScriptView Raw
1import type { Integration, IntegrationFn } from '@sentry/core';
2export interface FeatureFlagsIntegration extends Integration {
3 addFeatureFlag: (name: string, value: unknown) => void;
4}
5/**
6 * Sentry integration for buffering feature flags manually with an API, and
7 * capturing them on error events. We recommend you do this on each flag
8 * evaluation. Flags are buffered per Sentry scope and limited to 100 per event.
9 *
10 * See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.
11 *
12 * @example
13 * ```
14 * import * as Sentry from '@sentry/browser';
15 * import { type FeatureFlagsIntegration } from '@sentry/browser';
16 *
17 * // Setup
18 * Sentry.init(..., integrations: [Sentry.featureFlagsIntegration()])
19 *
20 * // Verify
21 * const flagsIntegration = Sentry.getClient()?.getIntegrationByName<FeatureFlagsIntegration>('FeatureFlags');
22 * if (flagsIntegration) {
23 * flagsIntegration.addFeatureFlag('my-flag', true);
24 * } else {
25 * // check your setup
26 * }
27 * Sentry.captureException(Exception('broke')); // 'my-flag' should be captured to this Sentry event.
28 * ```
29 */
30export declare const featureFlagsIntegration: IntegrationFn<FeatureFlagsIntegration>;
31//# sourceMappingURL=featureFlagsIntegration.d.ts.map
\No newline at end of file