Client library

Undercurrent’s event ingest is wire-compatible with Mixpanel. You track events by adding the official Mixpanel client library for your platform and pointing it at Undercurrent’s ingest endpoint. This can be done effectively by your AI coding harness.

Delegating setup to an AI harness

Paste this prompt into your coding harness in your app repo. It installs the library, configures it, and instruments your key user interactions.

What it does

  1. Adds the Mixpanel client library for your platform (iOS, Android, React Native, or Flutter) as a dependency. See Install Mixpanel → Code.
  2. Wraps the library in a reusable analytics service rather than calling it directly throughout the app. If another analytics service already exists, Undercurrent is added alongside it, not in place of it.
  3. Initialises the client with the server URL of https://ingest.undercurrentanalytics.dev and project token taken from your credentials file.
  4. Identifies each user with a stable, anonymous distinct ID (reuses an existing one, or a device ID where available).
  5. Instruments key interactions with clearly named events and useful properties.

When you’re done

Your app should:

  • Depend on the Mixpanel client library for your platform.
  • Initialise Mixpanel with your project token and serverURL set to https://ingest.undercurrentanalytics.dev.
  • Identify each user with a stable distinct ID.
  • Send events for the interactions you care about.

Events typically appear in your data within a few minutes. You can test it in Grafana’s Explore view by running a query like SELECT * FROM $__table WHERE $__timeFilter(time). Once events are flowing in, move on to dashboard creation.

← Back to undercurrentanalytics.dev