Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import {
import {hasEveryAccess} from 'sentry/components/acl/access';
import Alert from 'sentry/components/alert';
import {Button} from 'sentry/components/button';
import {PROVIDER_OPTION_TO_URLS} from 'sentry/components/events/featureFlags/utils';
import {
PROVIDER_OPTION_TO_URLS,
ProviderOptions,
} from 'sentry/components/events/featureFlags/utils';
import Input from 'sentry/components/input';
import ExternalLink from 'sentry/components/links/externalLink';
import TextCopyInput from 'sentry/components/textCopyInput';
Expand Down Expand Up @@ -114,9 +117,13 @@ export default function OnboardingIntegrationSection({
</SubSection>
<SubSection>
<div>
{t(
"During the process of creating a webhook integration, you'll be given the option to sign the webhook. This is an auto-generated secret code that Sentry requires to verify requests from your feature flag service. Paste the secret below."
)}
{provider === ProviderOptions.UNLEASH
? t(
`During the process of creating a webhook integration, you'll be given the option to add an authorization header. This is a string (or "secret") that you choose so that Sentry can verify requests from your feature flag service. Paste your authorization string below.`
)
: t(
"During the process of creating a webhook integration, you'll be given the option to sign the webhook. This is an auto-generated secret code that Sentry requires to verify requests from your feature flag service. Paste the secret below."
)}
</div>
<InputTitle>{t('Secret')}</InputTitle>
<InputArea>
Expand Down
4 changes: 4 additions & 0 deletions static/app/components/events/featureFlags/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,21 @@ export const sortedFlags = ({
export enum ProviderOptions {
LAUNCHDARKLY = 'LaunchDarkly',
GENERIC = 'Generic',
UNLEASH = 'Unleash',
}

export enum IntegrationOptions {
LAUNCHDARKLY = 'LaunchDarkly',
OPENFEATURE = 'OpenFeature',
GENERIC = 'Generic',
UNLEASH = 'Unleash',
}

export const PROVIDER_OPTION_TO_URLS: Record<ProviderOptions, string | undefined> = {
[ProviderOptions.LAUNCHDARKLY]:
'https://app.launchdarkly.com/settings/integrations/webhooks/new?q=Webhooks',
[ProviderOptions.UNLEASH]:
'https://docs.sentry.io/organization/integrations/feature-flag/unleash/#set-up-change-tracking',
[ProviderOptions.GENERIC]:
'https://docs.sentry.io/organization/integrations/feature-flag/generic/#set-up-change-tracking',
};
16 changes: 16 additions & 0 deletions static/app/gettingStartedDocs/javascript/javascript.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,22 @@ client.addHooks(new Sentry.OpenFeatureIntegrationHook());

// Evaluating flags will record the result on the Sentry client.
const result = client.getBooleanValue('my-flag', false);`,
},
[IntegrationOptions.UNLEASH]: {
importStatement: `import { UnleashClient } from 'unleash-proxy-client';`,
integration: 'unleashIntegration(UnleashClient)',
sdkInit: `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!"));`,
},
[IntegrationOptions.GENERIC]: {
importStatement: ``,
Expand Down
7 changes: 6 additions & 1 deletion static/app/gettingStartedDocs/python/python.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ const FLAG_OPTION_TO_IMPORT: Record<IntegrationOptions, FlagImports> = {
module: 'openfeature',
integration: 'OpenFeatureIntegration',
},
[IntegrationOptions.UNLEASH]: {
module: 'unleash',
integration: 'UnleashIntegration',
},
[IntegrationOptions.GENERIC]: {
module: 'feature_flags',
integration: 'FeatureFlagsIntegration',
Expand Down Expand Up @@ -269,7 +273,8 @@ sentry_sdk.init(
integrations=[
${FLAG_OPTION_TO_IMPORT[featureFlagOptions.integration].integration}(),
]
)`,
)
`,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export default function NewProviderForm({
options={[
{value: 'LaunchDarkly', label: 'LaunchDarkly'},
{value: 'Generic', label: 'Generic'},
{value: 'Unleash', label: 'Unleash'},
]}
help={t(
'If you have already linked this provider, pasting a new secret will override the existing secret.'
Expand Down
Loading