JavaScript SDK API Reference

Complete method signature reference for @empmix/sdk-js.

EmpMix.init()

Initializes the SDK. Must be called before any other method.

ParameterTypeRequiredDescription
apiKeystringYesYour project's Public API key.
optionsobjectNoConfiguration options (autoPageView, batchSize, flushInterval, debug, apiHost).

EmpMix.track()

Queues an event to be sent to Emp-Mix.

ParameterTypeRequiredDescription
eventNamestringYesThe name of the event.
propertiesobjectNoOptional custom properties for the event.

EmpMix.identify()

Links the current anonymous device ID to a permanent user ID.

ParameterTypeRequiredDescription
userIdstringYesThe permanent user ID from your database.
profileobjectNoOptional properties to immediately set on the user's profile.

EmpMix.alias()

Aliases the current anonymous ID to a new permanent ID (used during sign up).

ParameterTypeRequiredDescription
newUserIdstringYesThe newly created permanent user ID.

EmpMix.setUserProperties()

Updates the currently identified user's profile without sending an event.

ParameterTypeRequiredDescription
propertiesobjectYesA dictionary of key-value pairs to set on the user.

EmpMix.increment()

Increments a numeric property on the user's profile.

ParameterTypeRequiredDescription
propertystringYesThe name of the numeric property.
amountnumberYesThe amount to increment by.

EmpMix.registerSuperProperties()

Registers properties to be sent with every single track call.

ParameterTypeRequiredDescription
propertiesobjectYesA dictionary of properties to attach to all future events.

EmpMix.reset()

Clears all cookies, localStorage queue, and distinct_ids. Call on logout.

ParameterTypeRequiredDescription
Last updated on June 4, 2026