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.

1.1 KB
Raw Blame
import { MakeLogicType, actions, kea, path, reducers } from 'kea'

export type NextJSRouter = 'instrumentation-client' | 'app' | 'pages'

export interface NextJsInstructionsLogicProps {
    initialRouter?: NextJSRouter
}

// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface nextJsInstructionsLogicValues {
    nextJsRouter: NextJSRouter
}

// Generated by kea-typegen. Update if you're an agent, ignore if you're human.
export interface nextJsInstructionsLogicActions {
    setNextJsRouter: (router: any) => {
        router: any
    }
}

export type nextJsInstructionsLogicType = MakeLogicType<nextJsInstructionsLogicValues, nextJsInstructionsLogicActions>

export const nextJsInstructionsLogic = kea<nextJsInstructionsLogicType>([
    path(['scenes', 'onboarding', 'sdks', 'nextJsInstructionsLogic']),
    actions({
        setNextJsRouter: (router) => ({ router }),
    }),
    reducers(({ props }) => ({
        nextJsRouter: [
            (props.initialRouter || 'instrumentation-client') as NextJSRouter,
            {
                setNextJsRouter: (_, { router }) => router,
            },
        ],
    })),
])