Configuration helpers
defineMixpanelClientConfig
Define typed browser SDK options in a configuration file.
defineMixpanelClientConfig() validates and returns browser SDK configuration without initializing Mixpanel.
Usage
mixpanel.client.config.ts
import { defineMixpanelClientConfig } from 'mixpanel-nuxt/config'
export default defineMixpanelClientConfig({
track_pageview: 'url-with-path',
record_block_class: /private/,
})
Type
Signature
function defineMixpanelClientConfig<T extends MixpanelClientConfig>(config: T): T
Type import
import type { MixpanelClientConfig } from 'mixpanel-nuxt/config'
Parameters
config
Type: MixpanelClientConfig
Browser SDK initialization options, including callbacks and regular expressions that cannot appear in inline module configuration.
The argument must be a plain object. null, arrays, functions and class instances throw a TypeError.
Return value
The same configuration object, with its inferred type preserved. The helper does not initialize the SDK or load the file.
See Configuration files for automatic discovery and custom paths.