Skip to content

Configurable API endpoints, miscellaneous updates and fixes

Compare
Choose a tag to compare
@tdumitrescu tdumitrescu released this 13 Nov 22:38
· 56 commits to master since this release

API endpoint routes can now be configured individually, so you can rename /track, /engage, and /groups HTTP endpoints arbitrarily. Configure with the api_routes option:

mixpanel.init(`my token`, {
  api_host: `https://my-proxy.example.com`,
  api_routes: {
    track: `foo/`,
    engage: `bar/`,
    groups: `baz/`,
  },
));

In the above example, event-tracking requests will go to https://my-proxy.example.com/foo/, user profile updates to https://my-proxy.example.com/bar/, etc.

Other fixes:

  • Event properties object passed to mixpanel.track() will no longer be mutated
  • Super properties are now reloaded from persistence when making every tracking call (i.e., kept fresh when another tab/window in the same browser has updated them)
  • Extra failsafe behavior for trying to clear queued requests when localStorage doesn't work on startup, e.g., when localStorage is full so writes fail
  • Block Chrome-Lighthouse user agent
  • Fix for error in add_group() when adding a new group to an existing list