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.

feat(settings): make the setup wizard the main install option (#118250)

Rafael Audibert39d652670fbc
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 8981721f3545..e799f9017a6a 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -14367,9 +14367,9 @@ snapshots:
scenes-app-settings-project--settings-project-danger-zone--light:
hash: v1.k794b7964.139c7e66330e547058a1c64dbcab85b8849c60a8ecef92823e600369216c7c30.0JE2ROCYs2rEkHgVJ9gDD1qQebHXqF_nwBmS66Xe1os
scenes-app-settings-project--settings-project-details--dark:
- hash: v1.k794b7964.2d80b044af3d07b72489df37fc2f9dfc6a166acb8b3cd852aac5d393ff1dbcdb.Jy9FkzcCtfm-4C6esgAjkeqr0yBFPSfpXAajYvz4nMs
+ hash: v1.k794b7964.450f4b94875af40668d095f4a6a0235890a747b31cfa14ddd55f6d4e35ec1768._LCXgkGgO9orznOe11RxtG11IpWNvAkvxp2CEHtxpA8
scenes-app-settings-project--settings-project-details--light:
- hash: v1.k794b7964.d299bc92084ef9067ba3445f339da4bd3130fbbd969be0968ce0e095db0363cf.fniCOYMWKDnSL0TOyduIyYT_45qHcclu-VMi6eK6fl4
+ hash: v1.k794b7964.dbfa1851be9b9f45b38d566b5f4c527c3ca6511c341c20e4c85aed36f9d31b34.a8sI2y1DTMUUtIiG4xIJLBkddAGgFPnEJsQhDncMY_w
scenes-app-settings-project--settings-project-integrations--dark:
hash: v1.k794b7964.8484a0bbba6aa377a653cc15fbd239ec0619b7ec33ed93a6a3e2e8774be597cd.A-JZy9ip0RW3SgvL4go3QCGy8B_nS-qDAqPFNZ91FHY
scenes-app-settings-project--settings-project-integrations--light:
diff --git a/frontend/src/scenes/settings/SettingsMap.tsx b/frontend/src/scenes/settings/SettingsMap.tsx
index c472325f2b4f..e89a8719b3b9 100644
--- a/frontend/src/scenes/settings/SettingsMap.tsx
+++ b/frontend/src/scenes/settings/SettingsMap.tsx
@@ -143,7 +143,7 @@ import { PathCleaningFiltersConfig } from './environment/PathCleaningFiltersConf
import { PersonDisplayNameProperties } from './environment/PersonDisplayNameProperties'
import { ProjectTimezoneName } from './environment/ProjectTimezoneName'
import { ReplayIntegrations } from './environment/ReplayIntegrations'
-import { SDKSetupInstructions } from './environment/SDKSetupInstructions'
+import { SDKInstallOptions } from './environment/SDKInstallOptions'
import {
CanvasCaptureSettings,
LogCaptureSettings,
@@ -245,9 +245,9 @@ export const SETTINGS_MAP: SettingSection[] = [
id: 'snippet',
title: 'SDK setup',
description:
- 'Install PostHog in your app using one of our SDKs. Select your platform to see the setup instructions.',
+ 'Install PostHog in your app with Wizard, or set it up manually by following the instructions for your platform.',
docsUrl: 'https://posthog.com/docs/getting-started/install',
- component: <SDKSetupInstructions />,
+ component: <SDKInstallOptions />,
keywords: [
'install',
'setup',
@@ -255,6 +255,8 @@ export const SETTINGS_MAP: SettingSection[] = [
'code',
'sdk',
'snippet',
+ 'wizard',
+ 'setup agent',
'javascript',
'html',
'react',
diff --git a/frontend/src/scenes/settings/environment/SDKInstallOptions.tsx b/frontend/src/scenes/settings/environment/SDKInstallOptions.tsx
new file mode 100644
index 000000000000..5913e1110cf4
--- /dev/null
+++ b/frontend/src/scenes/settings/environment/SDKInstallOptions.tsx
@@ -0,0 +1,42 @@
+import { useState } from 'react'
+
+import { IconChevronDown, IconChevronRight } from '@posthog/icons'
+import { LemonButton } from '@posthog/lemon-ui'
+
+import { useWizardCommand } from 'scenes/onboarding/shared/useWizardCommand'
+import { WizardCommandBlock } from 'scenes/onboarding/shared/wizard-sync/WizardCommandBlock'
+
+import { SDKSetupInstructions } from './SDKSetupInstructions'
+
+export function SDKInstallOptions(): JSX.Element {
+ const { isCloudOrDev } = useWizardCommand()
+ const [showManualSetup, setShowManualSetup] = useState(false)
+
+ // The wizard CLI only reaches cloud and dev instances, so self-hosted keeps the manual instructions as the only path.
+ if (!isCloudOrDev) {
+ return <SDKSetupInstructions />
+ }
+
+ return (
+ <div className="space-y-4 max-w-200">
+ <p className="mb-0">Run this command from the root of your project to start the setup agent.</p>
+ <WizardCommandBlock />
+ <div>
+ <LemonButton
+ icon={showManualSetup ? <IconChevronDown /> : <IconChevronRight />}
+ onClick={() => setShowManualSetup(!showManualSetup)}
+ size="small"
+ type="tertiary"
+ data-attr="sdk-setup-manual-toggle"
+ >
+ Set up manually
+ </LemonButton>
+ {showManualSetup && (
+ <div className="mt-3">
+ <SDKSetupInstructions />
+ </div>
+ )}
+ </div>
+ </div>
+ )
+}