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.

2.7 KB
Raw Blame
import { OnboardingComponentsContext, createInstallation } from 'scenes/onboarding/shared/OnboardingDocsContentWrapper'

import { StepDefinition } from '../steps'

export const getLangfuseSteps = (ctx: OnboardingComponentsContext): StepDefinition[] => {
    const { CodeBlock, Markdown, CalloutBox, dedent } = ctx

    return [
        {
            title: 'Add Langfuse Tracing',
            badge: 'required',
            content: (
                <>
                    <Markdown>
                        Langfuse supports most popular LLM models and you can bring your Langfuse data into PostHog for
                        analysis.
                    </Markdown>
                    <Markdown>
                        {`1. First add [Langfuse Tracing](https://langfuse.com/docs/tracing) to your LLM app.
2. In your [Langfuse dashboard](https://cloud.langfuse.com/), click on **Settings** and scroll down to the **Integrations** section to find the PostHog integration.`}
                    </Markdown>
                </>
            ),
        },
        {
            title: 'Configure the integration',
            badge: 'required',
            content: (
                <>
                    <Markdown>Click **Configure** and paste in your PostHog project token:</Markdown>
                    <CodeBlock
                        blocks={[
                            {
                                language: 'text',
                                file: 'API Key',
                                code: dedent`
                                <ph_project_token>
                            `,
                            },
                        ]}
                    />
                    <Markdown>Paste in your PostHog host:</Markdown>
                    <CodeBlock
                        blocks={[
                            {
                                language: 'text',
                                file: 'Host',
                                code: dedent`
                                <ph_client_api_host>
                            `,
                            },
                        ]}
                    />
                    <Markdown>Click **Enable** and then **Save**.</Markdown>
                    <CalloutBox type="fyi" title="Data sync timing">
                        <Markdown>
                            Langfuse batch exports your data into PostHog once a day, so it can take up to 24 hours for
                            your Langfuse data to appear in PostHog.
                        </Markdown>
                    </CalloutBox>
                </>
            ),
        },
    ]
}

export const LangfuseInstallation = createInstallation(getLangfuseSteps)