posthog-tours
Version:
A TypeScript package for creating guided tours in PostHog
30 lines (29 loc) • 803 B
TypeScript
import posthog from 'posthog-js';
export interface TourConfig {
name: string;
target: string;
onEligible?: (element: Element, tourId: string) => void;
}
export interface FeatureFlagTour {
flagKey: string;
tour: TourConfig;
}
export interface TourEligibilityResult {
eligible: boolean;
element: Element | null;
tourId: string;
flagEnabled: boolean;
targetPresent: boolean;
alreadySeen: boolean;
}
export interface PostHogToursOptions {
tours: Record<string, TourConfig>;
posthogInstance?: typeof posthog;
userPropertyPrefix?: string;
defaultOnEligible?: (element: Element, tourId: string) => void;
checkElementVisibility?: boolean;
debug?: boolean;
}
export declare class PostHogNotInitializedError extends Error {
constructor();
}