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.6 KB
Raw Blame
import { LegacyTransformationPlugin } from '../../types'
import { processEvent } from './dist'
import { setupPlugin } from './index'

// NOTE: This is a deprecated plugin and should never be shown to new users

export const posthogRouteCensorPlugin: LegacyTransformationPlugin = {
    processEvent,
    setupPlugin: setupPlugin as any,
    template: {
        free: true,
        status: 'deprecated',
        type: 'transformation',
        id: 'plugin-posthog-route-censor-plugin',
        name: 'Route Censor',
        description: 'Removes segments of URLs based on route patterns.',
        icon_url: 'https://res.cloudinary.com/dmukukwp6/image/upload/q_auto,f_auto/builder_hog_01_955c082cad.png',
        category: ['Custom'],
        code_language: 'javascript',
        code: `return event`,
        inputs_schema: [
            {
                key: 'routes',
                templating: false,
                label: 'List of routes following the React Router route patterns.',
                description:
                    '[Example Here](https://github.com/ava-labs/posthog-route-censor-plugin/blob/main/src/assets/exampleRoutes.json).  See package [README](https://github.com/ava-labs/posthog-route-censor-plugin) for more details.',
                type: 'json',
                required: true,
            },
            {
                key: 'properties',
                templating: false,
                label: 'List of properties to censor',
                type: 'string',
                default: '$current_url,$referrer,$pathname,$initial_current_url,initial_pathname,initial_referrer',
                description: 'Separate properties with commas, without using spaces, like so: `foo,bar,$baz`',
                required: false,
            },
            {
                key: 'set_properties',
                templating: false,
                label: 'List of $set properties to censor',
                type: 'string',
                default: '$initial_current_url,$initial_pathname,$initial_referrer',
                description: 'Separate properties with commas, without using spaces, like so: `foo,bar,$baz`',
                required: false,
            },
            {
                key: 'set_once_properties',
                templating: false,
                label: 'List of $set_once properties to censor',
                type: 'string',
                default: '$initial_current_url,$initial_pathname,$initial_referrer',
                description: 'Separate properties with commas, without using spaces, like so: `foo,bar,$baz`',
                required: false,
            },
        ],
    },
}