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

143 lines
7.1 KiB
TypeScript

import { OnboardingComponentsContext, createInstallation } from 'scenes/onboarding/shared/OnboardingDocsContentWrapper'
import { StepDefinition } from '../steps'
export const getAndroidSteps = (ctx: OnboardingComponentsContext): StepDefinition[] => {
const { CodeBlock, Markdown, CalloutBox, dedent, snippets } = ctx
const SessionReplayFinalSteps = snippets?.SessionReplayFinalSteps
return [
{
title: 'Install the dependency',
badge: 'required',
content: (
<>
<Markdown>Add the Insights Android SDK to your `build.gradle` dependencies:</Markdown>
<CodeBlock
blocks={[
{
language: 'kotlin',
file: 'build.gradle',
code: dedent`
dependencies {
implementation("com.insights:insights-android:3.+")
}
`,
},
]}
/>
<CalloutBox type="fyi" title="SDK version">
<Markdown>
Session replay requires Insights Android SDK version 3.4.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: 'kotlin',
file: 'SampleApp.kt',
code: dedent`
class SampleApp : Application() {
companion object {
const val INSIGHTS_TOKEN = "<ph_project_token>"
const val INSIGHTS_HOST = "<ph_client_api_host>"
}
override fun onCreate() {
super.onCreate()
val config = InsightsAndroidConfig(
apiKey = INSIGHTS_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
// Capture logs automatically. Default is true.
//
// Support for remote configuration
// in the [session replay settings](https://app.hanzo.ai/settings/project-replay#replay-log-capture)
// requires SDK version 3.32.0 or higher.
config.sessionReplayConfig.captureLogcat = true
// Whether replays are created using high quality screenshots. Default is false.
// If disabled, replays are created using wireframes instead.
// The screenshot may contain sensitive information, so use with caution
config.sessionReplayConfig.screenshot = false
// Throttle delay used to reduce the number of snapshots captured. Default is 1000ms
config.sessionReplayConfig.throttleDelayMs = 1000
// 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 null (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.34.0 or higher.
config.sessionReplayConfig.sampleRate = null
InsightsAndroid.setup(this, config)
}
}
`,
},
]}
/>
<Markdown>
For more configuration options, see the [Android session replay
docs](https://hanzo.ai/docs/session-replay/installation?tab=Android).
</Markdown>
<CalloutBox type="fyi" title="Requirements">
<Markdown>
Requires Android API 26 or higher. Jetpack Compose is only supported if `screenshot` is
enabled.
</Markdown>
</CalloutBox>
</>
),
},
{
title: 'Watch session recordings',
badge: 'recommended',
content: <>{SessionReplayFinalSteps && <SessionReplayFinalSteps />}</>,
},
]
}
export const AndroidInstallation = createInstallation(getAndroidSteps)