# initializeMixpanel

Initialize Mixpanel with Workleap's default settings.

# Reference

initializeMixpanel(productId, envOrTrackingApiBaseUrl, options?: { verbose });

# Parameters

  • productId: The product id.
  • envOrTrackingApiBaseUrl: The environment to get the navigation url from or a base URL.
  • options: An optional object literal of options:
    • verbose: Whether or not debug information should be logged to the console.

# Environments

Supported environments are:

  • production
  • staging
  • development
  • local
  • msw

# Usage

# Initialize with a predefined environment

Mixpanel can be initialized for any of the following predefined environments:

  • production
  • staging
  • development
  • local
  • msw
import { initializeMixpanel } from "@workleap/mixpanel";

initializeMixpanel("wlp", "development");

# Initialize with a base url

import { initializeMixpanel } from "@workleap/mixpanel";

initializeMixpanel("wlp", "https://my-tracking-api");

# Verbose mode

To log to the console debugging information, set the verbose option to true:

import { initializeMixpanel } from "@workleap/mixpanel";

initializeMixpanel("wlp", "development", {
    verbose: true
});