UNPKG

@mintlify/common

Version:

Commonly shared code within Mintlify

27 lines (26 loc) 3.44 kB
export declare const PAGE_VIEW_EVENT = "docs.content.view"; /** * Analytics event names following a standardized naming convention. * * @description All event names follow the format: `platform.noun.action` * - **platform**: The platform where the event occurs (e.g., 'docs') * - **noun**: The component or feature being interacted with (e.g., 'expandable', 'search') * - **action**: The specific action taken (e.g., 'open', 'click', 'copy') */ export declare const ANALYTICS_EVENTS: readonly ["docs.content.view", "docs.expandable.open", "docs.expandable.close", "docs.accordion.open", "docs.accordion.close", "docs.navitem.click", "docs.navitem.cta_click", "docs.search.query", "docs.search.close", "docs.api_playground.request", "docs.search.result_click", "docs.code_block.copy", "docs.code_block.ask_ai", "docs.feedback.thumbs_up", "docs.feedback.thumbs_down", "docs.feedback.detailed_submitted", "docs.footer.powered_by_mintlify_click", "docs.assistant.enter", "docs.assistant.completed", "docs.assistant.shared", "docs.assistant.source_click", "docs.assistant.web_search_click", "docs.assistant.thumbs_up", "docs.assistant.thumbs_down", "docs.assistant.suggestion_click", "docs.assistant.question_option_click", "docs.assistant.starter_question_clicked", "docs.assistant.maximize_click", "docs.assistant.minimize_click", "docs.assistant.copy_response", "docs.assistant.ask_ai_on_text_selection", "docs.assistant.spam_detected", "docs.assistant.attachment_upload", "docs.assistant.attachment_rejected", "docs.assistant.attachment_limit_exceeded", "docs.context_menu.copy_page", "docs.context_menu.copy_mcp_link", "docs.context_menu.ai_provider_click", "docs.context_menu.install_mcp_server", "docs.context_menu.copy_add_mcp_command", "docs.context_menu.download_api_spec", "docs.autopilot.suggestion.created", "docs.autopilot.suggestion.no_suggestion", "mcp.tool_call.search", "docs.content.md.view", "docs.banner.atlas_signup_click", "docs.banner.atlas_claim_click", "docs.banner.atlas_share_click", "docs.atlas_content.view", "docs.search.comparison", "preview_widget.file_list.viewed", "preview_widget.file.opened", "preview_widget.file.editor_opened"]; export type AnalyticsEvent = (typeof ANALYTICS_EVENTS)[number]; export declare function isAnalyticsEvent(value: string): value is AnalyticsEvent; /** * @deprecated Use the new format instead * @Date 2025-06-16 (remove this in two months) */ export declare const DEPRECATED_ANALYTICS_EVENTS: readonly ["expandable_open", "expandable_close", "accordion_open", "accordion_close", "header_nav_item_click", "cta_click", "scroll_to_bottom", "search_close", "api_playground_call", "search_result_click", "chat_enter", "chat_followup", "chat_completed", "code_block_copy", "chat_shared", "thumb_vote", "powered_by_mintlify_click", "ai_chat_citation_click", "ai_chat_feedback_positive_click", "ai_chat_feedback_negative_click", "ask_ai_code_block", "assistant.spam_detected"]; /** @deprecated Use AnalyticsEvent instead */ export type DeprecatedAnalyticsEvent = (typeof DEPRECATED_ANALYTICS_EVENTS)[number]; /** @deprecated Use isAnalyticsEvent instead */ export declare function isDeprecatedAnalyticsEvent(value: string): value is DeprecatedAnalyticsEvent; /** * Mapping from new analytics events to their deprecated equivalents * to maintain backward compatibility */ export declare const analyticsEventMapping: Partial<Record<AnalyticsEvent, DeprecatedAnalyticsEvent>>;