useMixpanelClient

Retrieve a MixpanelClient instance.

Reference

const client = useMixpanelClient(options?: { throwOnUndefined? });

Parameters

  • options: An optional object literal of options:
    • throwOnUndefined: Whether or not an exception should be thrown if a client instance hasn't been provided.

Returns

A MixpanelClient instance.

Usage

import { useMixpanelClient } from "@workleap/telemetry/react";

const client = useMixpanelClient();

client.setGlobalEventProperties({
    "User Id": "123"
});