Files
zeekay 10e6fec4c0 debrand: the brand token is INSIGHTS_, and a wrong one stops the container
The rule table mapped HOG_ -> FN_ ahead of any POSTHOG rule, so POSTHOG_FOO
split into POST + HOG_ and came out POSTFN_FOO. Nothing sets that. The live
pods set INSIGHTS_SKIP_MIGRATION_CHECKS, which bin/migrate-check reads on the
container entrypoint, so the misspelling does not degrade a feature -- it runs
migrate --check against a database whose history this tree does not share and
the container never starts.

Both replacements are measured against the shipped tree rather than chosen:
every HOG_ name with a counterpart there is spelled INSIGHTS_ (HOG_QL ->
INSIGHTS_QL, HOG_FUNCTION_TEMPLATES -> INSIGHTS_FUNCTION_TEMPLATES, 12 of 12
determinate cases), and FN_ appears in it nowhere. Upstream carries 95 HOG_
tokens and zero FN_ ones, so repairing FN_ back out is exactly the inverse of
the bad rule and cannot collide with an upstream name.

The rule is fixed for the next convergence, and the tree it already produced is
repaired in the same commit -- the codemod is idempotent against its own output,
so it cannot undo this itself.
2026-08-01 17:42:28 -07:00

160 lines
8.3 KiB
TypeScript

import { OnboardingComponentsContext, createInstallation } from 'scenes/onboarding/shared/OnboardingDocsContentWrapper'
import { StepDefinition } from '../steps'
export const getIOSSteps = (ctx: OnboardingComponentsContext): StepDefinition[] => {
const { CodeBlock, Markdown, CalloutBox, dedent, snippets } = ctx
const SessionReplayFinalSteps = snippets?.SessionReplayFinalSteps
return [
{
title: 'Install the SDK',
badge: 'required',
content: (
<>
<Markdown>Add Insights to your Podfile:</Markdown>
<CodeBlock
blocks={[
{
language: 'ruby',
file: 'Podfile',
code: dedent`
pod "Insights", "~> 3.56"
`,
},
]}
/>
<Markdown>Or install via Swift Package Manager:</Markdown>
<CodeBlock
blocks={[
{
language: 'swift',
file: 'Package.swift',
code: dedent`
dependencies: [
.package(url: "https://github.com/Insights/insights-ios.git", from: "3.56.0")
]
`,
},
]}
/>
<CalloutBox type="fyi" title="SDK version">
<Markdown>
Session replay requires Insights iOS SDK version 3.6.0 or higher. We recommend always using
the latest version.
</Markdown>
</CalloutBox>
</>
),
},
{
title: 'Enable session recordings in project settings',
badge: 'required',
content: (
<>
<Markdown>
Go to your Insights [Project Settings](https://us.hanzo.ai/settings/project-replay) and enable
**Record user sessions**. Session recordings will not work without this setting enabled.
</Markdown>
</>
),
},
{
title: 'Configure Insights with session replay',
badge: 'required',
content: (
<>
<Markdown>
Add `sessionReplay = true` to your Insights configuration. Here are all the available options:
</Markdown>
<CodeBlock
blocks={[
{
language: 'swift',
file: 'AppDelegate.swift',
code: dedent`
import Foundation
import Insights
import UIKit
class AppDelegate: NSObject, UIApplicationDelegate {
func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
let INSIGHTS_PROJECT_TOKEN = "<ph_project_token>"
let INSIGHTS_HOST = "<ph_client_api_host>"
let config = InsightsConfig(projectToken: INSIGHTS_PROJECT_TOKEN, host: INSIGHTS_HOST)
// Enable session recording. Requires enabling in your project settings as well.
// Default is false.
config.sessionReplay = true
// Whether text and text input fields are masked. Default is true.
// Password inputs are always masked regardless
config.sessionReplayConfig.maskAllTextInputs = true
// Whether images are masked. Default is true.
config.sessionReplayConfig.maskAllImages = true
// Whether logs are captured in recordings. Default is false.
//
// Support for remote configuration
// in the [session replay settings](https://app.hanzo.ai/settings/project-replay#replay-log-capture)
// requires SDK version 3.41.1 or higher.
config.sessionReplayConfig.captureLogs = false
// Whether network requests are captured in recordings. Default is true
// Only metric-like data like speed, size, and response code are captured.
// No data is captured from the request or response body.
//
// Support for remote configuration
// in the [session replay settings](https://app.hanzo.ai/settings/project-replay#replay-network)
// requires SDK version 3.41.1 or higher.
config.sessionReplayConfig.captureNetworkTelemetry = true
// Whether replays are created using high quality screenshots. Default is false.
// Required for SwiftUI.
// If disabled, replays are created using wireframes instead.
// The screenshot may contain sensitive information, so use with caution
config.sessionReplayConfig.screenshotMode = true
// Sample rate for session recordings. A value between 0.0 and 1.0.
// 1.0 means 100% of sessions will be recorded. 0.5 means 50%, and so on.
// Default is nil (all sessions are recorded).
//
// Support for remote configuration
// in the [session replay triggers](https://us.hanzo.ai/settings/project-replay#replay-triggers)
// requires SDK version 3.42.0 or higher.
config.sessionReplayConfig.sampleRate = nil
InsightsSDK.shared.setup(config)
return true
}
}
`,
},
]}
/>
<Markdown>
For more configuration options, see the [iOS session replay
docs](https://hanzo.ai/docs/session-replay/installation?tab=iOS).
</Markdown>
<CalloutBox type="fyi" title="SwiftUI support">
<Markdown>
SwiftUI is only supported if the `screenshotMode` option is enabled. Custom views and
WebViews also require screenshot mode for full support.
</Markdown>
</CalloutBox>
</>
),
},
{
title: 'Watch session recordings',
badge: 'recommended',
content: <>{SessionReplayFinalSteps && <SessionReplayFinalSteps />}</>,
},
]
}
export const IOSInstallation = createInstallation(getIOSSteps)