Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(integrations): remove remaining Stripe sandbox install code (#64150)

Matt Brooker2b4af911ef41
diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts
index 41695440fffc..151fb84ddeec 100644
--- a/frontend/src/lib/api.ts
+++ b/frontend/src/lib/api.ts
@@ -6069,7 +6069,7 @@ const api = {
async list(): Promise<PaginatedResponse<IntegrationType>> {
return await new ApiRequest().integrations().get()
},
- authorizeUrl(params: { kind: string; next?: string; is_sandbox?: boolean }): string {
+ authorizeUrl(params: { kind: string; next?: string }): string {
return new ApiRequest().integrations().withAction('authorize').withQueryString(params).assembleFullUrl(true)
},
async slackChannels(
diff --git a/frontend/src/lib/components/CyclotronJob/integrations/IntegrationChoice.tsx b/frontend/src/lib/components/CyclotronJob/integrations/IntegrationChoice.tsx
index 0584fc748000..79702dd95de9 100644
--- a/frontend/src/lib/components/CyclotronJob/integrations/IntegrationChoice.tsx
+++ b/frontend/src/lib/components/CyclotronJob/integrations/IntegrationChoice.tsx
@@ -84,11 +84,6 @@ export function IntegrationChoice({
closeNewIntegrationModal()
}
- // Stripe sandboxes have a separate client_id from live installs. The Stripe app
- // forwards is_sandbox=true on the URL it sends users to, so we forward it through
- // to the authorize endpoint when it's present.
- const isSandbox = new URLSearchParams(window.location.search).get('is_sandbox') === 'true'
-
const setupDef = getIntegrationSetup(kind)
// When the instance doesn't have OAuth credentials for this kind, /integrations/authorize
// 400s with "Kind not configured". Send users to the settings page instead.
@@ -102,7 +97,7 @@ export function IntegrationChoice({
label: `${kindName} is not configured on this instance`,
}
: {
- to: api.integrations.authorizeUrl({ kind, next: redirectUrl, is_sandbox: isSandbox || undefined }),
+ to: api.integrations.authorizeUrl({ kind, next: redirectUrl }),
disableClientSideRouting: true,
onClick: beforeRedirect,
label: integrationsOfKind?.length
diff --git a/services/stripe-app/src/constants.ts b/services/stripe-app/src/constants.ts
index d400ab87eff4..c2e5653b10fb 100644
--- a/services/stripe-app/src/constants.ts
+++ b/services/stripe-app/src/constants.ts
@@ -27,18 +27,6 @@ export function getConstants(environment: ExtensionContextValue['environment']):
return (environment?.constants as unknown as AppConstants | undefined) ?? FALLBACK_CONSTANTS
}
-// Stripe issues separate client_ids for sandbox vs live installs of the same app,
-// so PostHog needs to know which one to use when starting OAuth. The Stripe app
-// passes is_sandbox=true through to PostHog when the user is connecting from a
-// sandbox account; PostHog forwards it to /integrations/authorize.
-export function appendSandboxParam(url: string, isSandbox: boolean): string {
- if (!isSandbox) {
- return url
- }
- const separator = url.includes('?') ? '&' : '?'
- return `${url}${separator}is_sandbox=true`
-}
-
export { BrandIcon }
export interface Timeframe {
diff --git a/services/stripe-app/src/views/FullPage.tsx b/services/stripe-app/src/views/FullPage.tsx
index 26e4fa86691e..4ee69dc56148 100644
--- a/services/stripe-app/src/views/FullPage.tsx
+++ b/services/stripe-app/src/views/FullPage.tsx
@@ -5,7 +5,7 @@ import { useCallback, useEffect, useState } from 'react'
import Stripe from 'stripe'
import { DevTokenEntry } from '../components/PostHogConnect'
-import { appendSandboxParam, BRAND_COLOR, BrandIcon, getConstants } from '../constants'
+import { BRAND_COLOR, BrandIcon, getConstants } from '../constants'
import EventsTab from '../fullPage/EventsTab'
import ExperimentsTab from '../fullPage/ExperimentsTab'
import FeatureFlagsTab from '../fullPage/FeatureFlagsTab'
@@ -25,7 +25,7 @@ const DISCONNECTED_DESCRIPTION =
'PostHog gives you product analytics, session replays, experiments, and feature flags for your Stripe customers. ' +
'To get started, connect this Stripe account from your PostHog dashboard.'
-const FullPage = ({ environment, userContext }: ExtensionContextValue): JSX.Element => {
+const FullPage = ({ environment }: ExtensionContextValue): JSX.Element => {
const [state, setState] = useState<ConnectionState>({ status: 'loading' })
// The runtime passes a fresh `environment` prop on every render, so anything derived
@@ -33,7 +33,6 @@ const FullPage = ({ environment, userContext }: ExtensionContextValue): JSX.Elem
// and we end up in a render → fetch → setState loop.
const [constants] = useState(() => getConstants(environment))
const [mode] = useState<'live' | 'test'>(() => environment?.mode ?? 'live')
- const [isSandbox] = useState<boolean>(() => userContext?.account?.isSandbox ?? false)
const loadConnection = useCallback(async (): Promise<void> => {
try {
@@ -83,7 +82,7 @@ const FullPage = ({ environment, userContext }: ExtensionContextValue): JSX.Elem
descriptionActionLabel="Learn more"
primaryAction={{
label: 'Connect in PostHog',
- href: appendSandboxParam(constants.POSTHOG_NEW_SOURCE_URL, isSandbox),
+ href: constants.POSTHOG_NEW_SOURCE_URL,
target: '_blank',
}}
secondaryAction={{
diff --git a/services/stripe-app/stripe-app.json b/services/stripe-app/stripe-app.json
index ea9e371d79b6..bbdf89d5f068 100644
--- a/services/stripe-app/stripe-app.json
+++ b/services/stripe-app/stripe-app.json
@@ -128,6 +128,5 @@
"https://app.posthog.com/integrations/stripe/callback"
],
"distribution_type": "public",
- "stripe_api_access_type": "oauth",
- "sandbox_install_compatible": true
+ "stripe_api_access_type": "oauth"
}