Unleash

Learn how to use Sentry with Unleash.

The Unleash integration tracks feature flag evaluations produced by the Unleash SDK. These evaluations are held in memory, and in the event an error occurs, sent to Sentry for review and analysis. At the moment, we only support boolean flag evaluations. This integration is available in Sentry SDK versions 8.51.0 or higher.

Import names: Sentry.unleashIntegration

Before using this integration, you need to install and instrument Unleash in your app. Learn more by reading Unleash's SDK reference and quickstart.

Copied
import * as Sentry from "@sentry/sveltekit";
import { UnleashClient } from "unleash-proxy-client";

Sentry.init({
  dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
  integrations: [
    Sentry.unleashIntegration({ unleashClientClass: UnleashClient }),
  ],
});

const unleash = new UnleashClient({
  url: "https://<your-unleash-instance>/api/frontend",
  clientKey: "<your-client-side-token>",
  appName: "my-webapp",
});

unleash.start();

// Evaluate a flag with a default value. You may have to wait for your client to synchronize first.
unleash.isEnabled("test-flag");

Sentry.captureException(new Error("Something went wrong!"));

Visit the Sentry website and confirm that your error event has recorded the feature flag "test-flag" and its value "false".

Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").