Skip to content

Latest commit

 

History

History
45 lines (35 loc) · 1.9 KB

File metadata and controls

45 lines (35 loc) · 1.9 KB

Before using this integration, you need to install and instrument both the OpenFeature SDK and the OpenFeature Flagsmith provider in your app. Learn more by reading OpenFeature's SDK docs and provider docs.

import * as Sentry from '@sentry/angular';
import { FlagsmithClientProvider } from '@openfeature/flagsmith-client-provider';
import { OpenFeature } from '@openfeature/web-sdk';

Sentry.init({
  dsn: '___PUBLIC_DSN___',
  integrations: [Sentry.openFeatureIntegration()]
});

const flagsmithClientProvider = new FlagsmithClientProvider({
  environmentID: '<ENVIRONMENT_ID>'
});
OpenFeature.setProvider(flagsmithClientProvider);

OpenFeature.addHooks(new Sentry.OpenFeatureIntegrationHook());

const client = OpenFeature.getClient();
const result = client.getBooleanValue('test-flag', false); // evaluate with a default value
Sentry.captureException(new Error('Something went wrong!'));
import * as Sentry from '@sentry/angular';
import { FlagsmithClientProvider } from '@openfeature/flagsmith-client-provider';
import { OpenFeature } from '@openfeature/web-sdk';

Sentry.init({
  dsn: '___PUBLIC_DSN___',
  integrations: [Sentry.openFeatureIntegration()]
});

const flagsmithClientProvider = new FlagsmithClientProvider({
  environmentID: '<ENVIRONMENT_ID>'
});
OpenFeature.setProvider(flagsmithClientProvider);

const client = OpenFeature.getClient();
client.addHooks(new Sentry.OpenFeatureIntegrationHook());

const result = client.getBooleanValue('test-flag', false); // evaluate with a default value
Sentry.captureException(new Error('Something went wrong!'));