Skip to content

Outdated JavaScript API documentation #540

Description

@Eric-Arellano

Hi, https://docs.mixpanel.com/docs/tracking-methods/sdks/javascript#library-configuration says to use https://github.com/mixpanel/mixpanel-js/blob/master/doc/readme.io/javascript-full-api-reference.md#mixpanelset_config for the API reference for the init options with Mixpanel.

However, that guide is missing some new properties, such as autocapture.

mixpanel-js/src/index.d.ts

Lines 158 to 226 in c23600f

export interface Config {
api_host: string;
api_routes: {
track?: string;
engage?: string;
groups?: string;
};
api_method: string;
api_transport: string;
app_host: string;
api_payload_format: ApiPayloadFormat;
autotrack: boolean;
cdn: string;
cookie_domain: string;
cross_site_cookie: boolean;
cross_subdomain_cookie: boolean;
flags: boolean | FlagsConfig;
persistence: Persistence;
persistence_name: string;
cookie_name: string;
loaded: (mixpanel: Mixpanel) => void;
store_google: boolean;
stop_utm_persistence: boolean;
save_referrer: boolean;
test: boolean;
verbose: boolean;
img: boolean;
/**
* @default false
* @see https://github.com/mixpanel/mixpanel-js/blob/master/doc/readme.io/javascript-full-api-reference.md#mixpanelset_config
*/
debug: boolean;
track_links_timeout: number;
track_pageview: TrackPageView;
autocapture: boolean | AutocaptureConfig;
skip_first_touch_marketing: boolean;
cookie_expiration: number;
upgrade: boolean;
disable_persistence: boolean;
disable_cookie: boolean;
disable_notifications: boolean;
secure_cookie: boolean;
ip: boolean;
property_blacklist: string[];
xhr_headers: XhrHeadersDef;
opt_out_tracking_by_default: boolean;
opt_out_persistence_by_default: boolean;
opt_out_tracking_persistence_type: Persistence;
opt_out_tracking_cookie_prefix: string;
inapp_protocol: string;
inapp_link_new_window: boolean;
ignore_dnt: boolean;
batch_requests: boolean;
batch_size: number;
batch_flush_interval_ms: number;
batch_request_timeout_ms: number;
record_block_class: string | RegExp;
record_block_selector: string;
record_collect_fonts: boolean;
record_idle_timeout_ms: number;
record_inline_images: boolean;
record_mask_text_class: string | RegExp;
record_mask_text_selector: string;
record_min_ms: number;
record_max_ms: number;
record_sessions_percent: number;
record_canvas: boolean;
record_heatmap_data: boolean;
}

Even better imo would be inlining the docs into the TypeScript file as JSDoc so that IDEs explain the interface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions