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.

3.9 KB
Raw Blame
import { combineUrl } from 'kea-router'

import { urls } from 'scenes/urls'

import { ProductItemCategory, ProductKey } from '~/queries/schema/schema-general'

import { ActivityScope, ProductManifest, RecordingUniversalFilters, ReplayTabs } from '../../frontend/src/types'

export const manifest: ProductManifest = {
    name: 'Replay',
    globalModals: {
        SessionPlayerModal: () =>
            import('scenes/session-recordings/player/modal/SessionPlayerModalHost').then(
                (module) => module.SessionPlayerModalHost
            ),
    },
    activityDescribers: {
        [ActivityScope.REPLAY]: () =>
            import('scenes/session-recordings/activityDescription').then((module) => module.replayActivityDescriber),
    },
    urls: {
        replay: (
            tab?: ReplayTabs,
            filters?: Partial<RecordingUniversalFilters>,
            sessionRecordingId?: string,
            order?: string
        ): string =>
            combineUrl(tab ? `/replay/${tab}` : '/replay/home', {
                ...(filters ? { filters } : {}),
                ...(sessionRecordingId ? { sessionRecordingId } : {}),
                ...(order ? { order } : {}),
            }).url,
        replayPlaylist: (id: string): string => `/replay/playlists/${id}`,
        replaySingle: (
            id: string,
            options?: { secondsOffsetFromStart?: number; unixTimestampMillis?: number }
        ): string => {
            if (options?.unixTimestampMillis) {
                return `/replay/${id}?timestamp=${options.unixTimestampMillis}`
            }
            if (options?.secondsOffsetFromStart) {
                return `/replay/${id}?t=${options.secondsOffsetFromStart}`
            }
            return `/replay/${id}`
        },
        replayFilePlayback: (): string => '/replay/file-playback',
        replayKiosk: (): string => '/replay/kiosk',
        replaySettings: (sectionId?: string): string => `/replay/settings${sectionId ? `?sectionId=${sectionId}` : ''}`,
    },
    fileSystemTypes: {
        session_recording_playlist: {
            name: 'Replay playlist',
            iconType: 'session_replay',
            href: (ref: string) => urls.replayPlaylist(ref),
            listHref: () => urls.replay(ReplayTabs.Playlists),
            iconColor: ['var(--color-product-session-replay-light)', 'var(--color-product-session-replay-dark)'],
            filterKey: 'session_recording_playlist',
        },
    },
    treeItemsProducts: [
        {
            path: 'Session replay',
            intents: [ProductKey.SESSION_REPLAY, ProductKey.MOBILE_REPLAY],
            category: ProductItemCategory.PRODUCT_ENGINEERING,
            href: urls.replay(ReplayTabs.Home),
            searchKeywords: ['replay', 'sessions', 'recordings', 'session recording'],
            searchTabs: [
                { name: 'Collections', href: urls.replay(ReplayTabs.Playlists), searchKeywords: ['playlists'] },
            ],
            type: 'session_recording_playlist',
            iconType: 'session_replay',
            iconColor: ['var(--color-product-session-replay-light)', 'var(--color-product-session-replay-dark)'],
            sceneKey: 'Replay',
            sceneKeys: [
                'Replay',
                'ReplaySingle',
                'ReplaySettings',
                'ReplayPlaylist',
                'ReplayFilePlayback',
                'ReplayKiosk',
            ],
        },
        // TODO: Move over to the `heatmaps` product folder once it exists
        {
            path: 'Heatmaps',
            intents: [ProductKey.HEATMAPS],
            category: ProductItemCategory.PRODUCT_ENGINEERING,
            iconType: 'heatmap',
            iconColor: ['var(--color-product-heatmaps-light)', 'var(--color-product-heatmaps-dark)'],
            href: urls.heatmaps(),
            searchKeywords: ['clickmaps', 'scrollmaps', 'scroll depth'],
            sceneKey: 'Heatmaps',
            sceneKeys: ['Heatmaps'],
        },
    ],
}