npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mixpanel/mixpanel-wizard

v1.2.0

Published

🚧 This package is in **beta** — features may change and bugs may be present. Feedback is welcome [[email protected]](mailto:[email protected])!

Readme

Mixpanel Installation Wizard 🧙‍♂️

🚧 This package is in beta — features may change and bugs may be present. Feedback is welcome [email protected]!

An interactive CLI tool that generates customized Mixpanel SDK installation instructions for AI-powered development environments. The wizard helps developers quickly integrate Mixpanel analytics into their applications across multiple platforms and programming languages.

Features

  • Multi-Platform Support: Supports 13+ SDKs including JavaScript, Python, iOS, Android, React Native, Flutter, and more
  • Interactive Setup: Guided prompts for configuration options like autocapture and session replay
  • Event Templates: Pre-built event schemas for AI, e-commerce, and general applications
  • AI-Optimized Output: Generates structured instructions specifically designed for AI coding assistants
  • Command Line Interface: Both interactive and non-interactive modes available

Supported SDKs

JavaScript, iOS (Swift/Objective-C), Android, React Native, Flutter, Unity, Python, Ruby, PHP, Go, Java, Node.js

Usage

This guide will help you add Mixpanel analytics to your app or website using AI assistance, even if you're not a developer. The Mixpanel Installation Wizard creates step-by-step instructions that you can give to AI coding tools like Claude, ChatGPT, or Cursor.

What You'll Need

Before starting, make sure you have:

  • A Mixpanel account with Admin or Owner access (sign up if you don't have one)
  • Access to an AI coding assistant (Claude, ChatGPT, Cursor, etc.)
    • Be sure to use the most advanced AI model you have access to
  • Your project's code files and a development or staging environment to test the changes

Step 1: Get Your Mixpanel Project Token

  1. Log into your Mixpanel account

  2. Go to your project settings (gear icon in the bottom left)

  3. Click on "Overview" in the left sidebar

  4. Scroll down to Access Keys section and copy your "Project Token" - it looks like a long string of letters and numbers

    (You will need to be an Admin or Owner in your project)

  5. Keep this handy - you'll need it in the next step

Step 2: Create Your AI Instructions

  1. Simply type npx @mixpanel/mixpanel-wizard in your terminal
  2. Go through and answer a few quick questions and it will then create a customized installation guide

Choose Your Settings

You'll need to pick three things:

A. Choose Your SDK Type

This depends on what type of app or website you're building:

  • javascript - For websites or web apps
  • react-native - For mobile apps built with React Native
  • ios-swift - For iPhone/iPad apps (Swift)
  • ios-objective-c - For iPhone/iPad apps (Objective-C)
  • android - For Android mobile apps
  • python - For Python applications
  • nodejs - For Node.js backend applications
  • flutter - For Flutter mobile apps
  • unity - For Unity games
  • go - For Go applications
  • ruby - For Ruby applications
  • php - For PHP applications
  • java - For Java applications

Don't see your platform? Check with a developer or choose the closest match.

B. Choose Your Event Type

This determines what kinds of user actions you'll track:

  • ai - Best for AI-powered features (chatbots, AI tools, ML features)
  • ecommerce - Best for online stores and shopping apps
  • default - Good general-purpose events for most other apps

C. Decide on Extra Features

  • Autocapture - Automatically tracks clicks and page views (JavaScript SDK only)
  • Session Replay - Records user sessions for debugging (JavaScript, iOS Swift, Android SDKs only)

Recommendation: Enable both if they're available for your platform

Step 3: Give Instructions to Your AI Assistant

  1. Open your AI coding tool (Claude, ChatGPT, Cursor, etc.).
  2. Copy over the instruction file generated from the step2 to your project.
  3. Make sure it has access to your project files
  4. Next, copy and paste this prompt into your AI Agent
Let's set up Mixpanel.
1. Set up mixpanel by following the steps in MIXPANEL_INSTALLATION_INSTRUCTIONS.txt. Make sure to follow the global rules specified in the MIXPANEL_INSTALLATION_INSTRUCTIONS.txt.
2. After completing the steps in the installation guide, delete the MIXPANEL_INSTALLATION_INSTRUCTIONS.txt
  1. Let the AI complete all the steps

The AI will:

  • Follow the generated setup instructions
  • Install the necessary code
  • Set up tracking for your chosen events

Step 4: Test Your Installation

After the AI completes the setup, test that everything is working:

Quick Test

  1. Deploy the changes to your testing environment
  2. Use your app or website normally
  3. Go to your Mixpanel dashboard
  4. Click on "Events" in the left sidebar or visit the Events page
  5. You should see events flowing in as you use your app (you may need to refresh Mixpanel)

What to Look For

Depending on your event type, you should see:

For AI events:

  • "Launch AI" when AI features are used
  • "AI Prompt Sent" when users send prompts
  • "AI Response Sent" when AI responds

For E-commerce events:

  • "Product Viewed" when products are viewed
  • "Add to Cart" when items are added to cart
  • "Purchase" when transactions complete

For Default events:

  • "Sign Up" for new user registrations
  • "Page View" for page visits
  • "Search" for search queries

Troubleshooting

No Events Showing Up?

  1. Check that you used the correct project token
  2. Verify your app is running and being used
  3. Wait a few minutes - sometimes there's a delay
  4. Check the browser console (F12) for any error messages

Wrong Events Tracking?

  1. Make sure you chose the right event type in Step 2B
  2. Ask your AI assistant to show you what events are being tracked
  3. You can always re-run the setup with different event types

Need Help?

  1. Check the Mixpanel documentation at docs.mixpanel.com
  2. Ask your AI assistant to explain what it installed
  3. Contact Mixpanel support through our help center

Success! 🎉

Once you see events flowing into your Mixpanel dashboard, you're all set! You can now:

  • View real-time user activity
  • Create reports and dashboards
  • Set up alerts for important events
  • Analyze user behavior patterns

The AI has set up all the technical details for you - now you can focus on understanding your users and growing your product.

Command Line Mode

Skip the interactive prompts by providing options directly:

# Basic usage
mixpanel-wizard --token YOUR_TOKEN --sdk javascript --events ai

# With additional options
mixpanel-wizard --token YOUR_TOKEN --sdk javascript --autocapture --sessionreplay --events ecommerce

# With approval for each code change
mixpanel-wizard --token YOUR_TOKEN --sdk javascript --confirm-each --events ai

# iOS with specific package manager
mixpanel-wizard --token YOUR_TOKEN --sdk ios-swift --events default

Available Options

| Option | Description | Values | | ----------------- | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | | -t, --token | Your Mixpanel project token | String | | --sdk | SDK type to install | javascript, flutter, ios-objective-c, ios-swift, android, react-native, go, python, ruby, php, nodejs,java, unity | | --events | Additional event type options | ai, ecommerce, default | | --autocapture | Enable autocapture (JavaScript only) | Boolean flag | | --sessionreplay | Enable session replay (Javascript, iOS Swift and Android Only) | Boolean flag | | --confirm-each | Require approval for each code change made by AI | Boolean flag |

Output

The wizard generates a MIXPANEL_INSTALLATION_INSTRUCTIONS.txt file containing:

  1. Step 1: SDK Installation - Platform-specific installation commands and configuration
  2. Step 2: User Identification - Code snippets for identifying users
  3. Step 3: Event Tracking - Implementation examples and event templates
  4. Best Practices - Security guidelines and recommendations

Simply provide the prompt from MIXPANEL_INSTALLATION_INSTRUCTIONS.txt to your AI coding agent.

Example Output Structure

You are a code-mod assistant tasked with adding Mixpanel analytics...

Global Rules
1. Ask before doing: When in doubt, ask for confirmation.
2. One small change at a time: Propose changes in small, reviewable steps.
...

Step 1: Install the Mixpanel SDK for javascript.
To install the Javascript SDK, paste the following code snippet...

Step 2: Identify your users to Mixpanel...
mixpanel.identify('USER_ID')
mixpanel.people.set({ '$name': 'Jane Doe'...

Step 3: Track events using the Mixpanel SDK...
Events and associated properties:
{
    eventName: "Launch AI",
    description: "Tracks when a user launches an AI-powered feature...",
    properties: []
}
...

Event Templates

Default Events

  • Sign Up: Track new user acquisition with signup method and UTM parameters
  • Sign In: Monitor user login events with authentication method tracking
  • Page View: Track page/screen views with URL and title information
  • Search: Capture search queries and result counts
  • Error: Monitor application errors with error types and messages
  • Purchase: Track completed transactions with revenue and currency data
  • Conversion: Monitor key value moments specific to your product type

AI Events

  • Launch AI: Track AI feature engagement and measure adoption patterns
  • AI Prompt Sent and Prompt Text: Capture user prompts and analyze engagement intent
  • AI Response Sent: Monitor AI outputs with cost, token usage, and response time metrics
  • API Error: Track AI feature errors and monitor failure rates
  • User Feedback: Collect user sentiment and feedback on AI interactions
  • AI Dismissed: Monitor AI feature disengagement points
  • Conversion Event: Measure how AI features influence key business outcomes

E-commerce Events

  • Purchase: Track completed transactions with cart contents and total price
  • Add to Cart: Monitor shopping behavior with cart items and product categories
  • Product Viewed: Track product engagement across the purchasing funnel
  • Ad Data: Monitor advertising spend and cost data for ROI calculations

License

This project is licensed under the Apache License - see the LICENSE.md file for details.

Support


⚠️ Important: This tool generates AI-optimized installation instructions. Always review and test the generated code before deploying to production. Human oversight is strongly recommended for all integrations.