Configuration helpers

defineMixpanelServerConfig

Define typed Node SDK options in a configuration file.

defineMixpanelServerConfig() validates and returns Node SDK configuration without initializing Mixpanel.

Usage

mixpanel.server.config.ts
import { defineMixpanelServerConfig } from 'mixpanel-nuxt/config'

export default defineMixpanelServerConfig({
  geolocate: false,
  debug: true,
})

Type

Signature
function defineMixpanelServerConfig<T extends MixpanelServerConfig>(config: T): T
Type import
import type { MixpanelServerConfig } from 'mixpanel-nuxt/config'

Parameters

config

Type: MixpanelServerConfig

Node SDK initialization options, including credentials and custom loggers excluded from 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.

Copyright © 2026