: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
import { PipelineResult, drop, ok } from '~/ingestion/framework/results'
import { ProcessingStep } from '~/ingestion/framework/steps'
import { Team } from '~/types'
type CheckHeatmapOptInInput = {
team: Team
}
export function createCheckHeatmapOptInStep<TInput extends CheckHeatmapOptInInput>(): ProcessingStep<TInput, TInput> {
return function checkHeatmapOptInStep(input: TInput): Promise<PipelineResult<TInput>> {
if (input.team.heatmaps_opt_in === false) {
return Promise.resolve(drop('heatmap_opt_in_disabled'))
}
return Promise.resolve(ok(input))
}
}