@posthog/wizard
Version:
The PostHog wizard helps you to configure your project
105 lines (104 loc) • 8.05 kB
TypeScript
import type { WizardOptions } from '../utils/types';
import { Integration } from './constants';
export declare const INTEGRATION_CONFIG: {
readonly nextjs: {
readonly name: "Next.js";
readonly filterPatterns: ["**/*.{tsx,ts,jsx,js,mjs,cjs}"];
readonly ignorePatterns: ["node_modules", "dist", "build", "public", "static", "next-env.d.*"];
readonly detect: (options: Pick<WizardOptions, "installDir">) => Promise<boolean>;
readonly generateFilesRules: "";
readonly filterFilesRules: "";
readonly docsUrl: "https://posthog.com/docs/libraries/next-js";
readonly defaultChanges: "• Installed posthog-js & posthog-node packages\n• Initialized PostHog and added pageview tracking\n• Created a PostHogClient to use PostHog server-side\n• Setup a reverse proxy to avoid ad blockers blocking analytics requests";
readonly nextSteps: "• Call posthog.identify() when a user signs into your app\n• Call posthog.capture() to capture custom events in your app";
};
readonly react: {
readonly name: "React";
readonly filterPatterns: ["**/*.{tsx,ts,jsx,js}"];
readonly ignorePatterns: ["node_modules", "dist", "build", "public", "static", "assets"];
readonly detect: (options: Pick<WizardOptions, "installDir">) => Promise<boolean>;
readonly generateFilesRules: "";
readonly filterFilesRules: "";
readonly docsUrl: "https://posthog.com/docs/libraries/react";
readonly defaultChanges: "• Installed posthog-js package\n• Added PostHogProvider to the root of the app, to initialize PostHog and enable autocapture";
readonly nextSteps: "• Call posthog.identify() when a user signs into your app\n• Call posthog.capture() to capture custom events in your app";
};
readonly svelte: {
readonly name: "Svelte";
readonly filterPatterns: ["**/*.{svelte,ts,js,jsx,tsx}"];
readonly ignorePatterns: ["node_modules", "dist", "build", "public", "static"];
readonly detect: (options: Pick<WizardOptions, "installDir">) => Promise<boolean>;
readonly generateFilesRules: "";
readonly filterFilesRules: "";
readonly docsUrl: "https://posthog.com/docs/libraries/svelte";
readonly defaultChanges: "• Installed posthog-js & posthog-node packages\n• Added PostHog initialization to your Svelte app\n• Setup pageview & pageleave tracking\n• Setup event auto - capture to capture events as users interact with your app\n• Added a getPostHogClient() function to use PostHog server-side";
readonly nextSteps: "• Call posthog.identify() when a user signs into your app\n• Use getPostHogClient() to start capturing events server - side";
};
readonly "react-native": {
readonly name: "React Native";
readonly filterPatterns: ["**/*.{ts,js,jsx,tsx}"];
readonly ignorePatterns: ["node_modules", "dist", "build", "public", "static"];
readonly detect: (options: Pick<WizardOptions, "installDir">) => Promise<boolean>;
readonly generateFilesRules: "";
readonly filterFilesRules: "";
readonly docsUrl: "https://posthog.com/docs/libraries/react-native";
readonly defaultChanges: "• Installed required packages\n• Added PostHogProvider to the root of the app\n• Enabled autocapture and session replay";
readonly nextSteps: "• Call posthog.identify() when a user signs into your app\n• Call posthog.capture() to capture custom events in your app";
};
readonly astro: {
readonly name: "Astro";
readonly filterPatterns: ["**/*.{astro,ts,js,jsx,tsx}"];
readonly ignorePatterns: ["node_modules", "dist", "build", "public", "static"];
readonly detect: (options: Pick<WizardOptions, "installDir">) => Promise<boolean>;
readonly generateFilesRules: "";
readonly filterFilesRules: "";
readonly docsUrl: "https://posthog.com/docs/libraries/js";
readonly defaultChanges: "• Added PostHog component with initialization script\n• Created PostHogLayout for consistent analytics tracking";
readonly nextSteps: "• Call posthog.identify() when a user signs into your app\n• Call posthog.capture() to capture custom events in your app\n• Use posthog.isFeatureEnabled() for feature flags";
};
readonly "react-router": {
readonly name: "React Router";
readonly filterPatterns: ["**/*.{tsx,ts,jsx,js}"];
readonly ignorePatterns: ["node_modules", "dist", "build", "public", "static", "assets"];
readonly detect: (options: Pick<WizardOptions, "installDir">) => Promise<boolean>;
readonly generateFilesRules: "";
readonly filterFilesRules: "";
readonly docsUrl: "https://posthog-git-react-post-hog.vercel.app/docs/libraries/react-router";
readonly defaultChanges: "• Installed posthog-js package\n• Added PostHogProvider to the root of the app\n• Integrated PostHog with React Router for pageview tracking";
readonly nextSteps: "• Call posthog.identify() when a user signs into your app\n• Call posthog.capture() to capture custom events in your app";
};
readonly django: {
readonly name: "Django";
readonly filterPatterns: ["**/*.py"];
readonly ignorePatterns: ["node_modules", "dist", "build", "public", "static", "venv", ".venv", "env", ".env", "__pycache__", "*.pyc", "migrations"];
readonly detect: (options: Pick<WizardOptions, "installDir">) => Promise<boolean>;
readonly generateFilesRules: "";
readonly filterFilesRules: "";
readonly docsUrl: "https://posthog.com/docs/libraries/django";
readonly defaultChanges: "• Installed posthog Python package\n• Added PostHog middleware for automatic event tracking\n• Configured PostHog settings in Django settings file";
readonly nextSteps: "• Use identify_context() within new_context() to associate events with users\n• Call posthog.capture() to capture custom events\n• Use feature flags with posthog.feature_enabled()";
};
readonly flask: {
readonly name: "Flask";
readonly filterPatterns: ["**/*.py"];
readonly ignorePatterns: ["node_modules", "dist", "build", "public", "static", "venv", ".venv", "env", ".env", "__pycache__", "*.pyc", "migrations", "instance"];
readonly detect: (options: Pick<WizardOptions, "installDir">) => Promise<boolean>;
readonly generateFilesRules: "";
readonly filterFilesRules: "";
readonly docsUrl: "https://posthog.com/docs/libraries/flask";
readonly defaultChanges: "• Installed posthog Python package\n• Added PostHog initialization to your Flask app\n• Configured automatic event tracking";
readonly nextSteps: "• Use posthog.identify() to associate events with users\n• Call posthog.capture() to capture custom events\n• Use feature flags with posthog.feature_enabled()";
};
readonly laravel: {
readonly name: "Laravel";
readonly filterPatterns: ["**/*.php"];
readonly ignorePatterns: ["node_modules", "vendor", "storage", "bootstrap/cache", "public/build", "public/hot", ".phpunit.cache"];
readonly detect: (options: Pick<WizardOptions, "installDir">) => Promise<boolean>;
readonly generateFilesRules: "";
readonly filterFilesRules: "";
readonly docsUrl: "https://posthog.com/docs/libraries/php";
readonly defaultChanges: "• Installed posthog/posthog-php via Composer\n• Added PostHog service provider\n• Configured automatic event tracking";
readonly nextSteps: "• Use PostHog::capture() to track custom events\n• Use PostHog::identify() to associate events with users";
};
};
export declare const INTEGRATION_ORDER: readonly [Integration.nextjs, Integration.astro, Integration.svelte, Integration.reactNative, Integration.reactRouter, Integration.django, Integration.flask, Integration.laravel, Integration.react];