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.

352 B
Raw Blame
/**
 * posthog_action.id is BIGINT, which pg returns as string.
 * Coerce id and team_id back to number since action IDs are well within safe integer range.
 */
export function coerceActionIds<T extends { id: unknown; team_id: unknown }>(action: T): T {
    action.id = Number(action.id)
    action.team_id = Number(action.team_id)
    return action
}