This repository (mixpanel/docs) is the source for Mixpanel's public-facing documentation at docs.mixpanel.com. It serves as both a documentation platform and a comprehensive reference for Mixpanel's analytics product, covering SDKs, APIs, data governance, and analytics features.
The repository fulfills two primary functions:
[email protected] with [email protected], deployed to Vercel@redocly/[email protected] and published to developer.mixpanel.comThe platform processes approximately 500+ MDX documentation pages and 10+ OpenAPI specification files, covering the complete Mixpanel product ecosystem including client SDKs (JavaScript, iOS, Android), server SDKs (Python, Node.js, Java), warehouse integrations, and analytics APIs.
The repository is organized into distinct subsystems, each documented in dedicated wiki sections:
Navigation to Detailed Documentation:
Sources: package.json1-60 README.md1-100 openapi/openapi.config.yaml1-48
The documentation platform is built on modern web technologies with strict version constraints:
| Component | Version | Purpose | Config File |
|---|---|---|---|
next | 14.2.32 | React framework, static site generation | next.config.mjs |
nextra | 3.3.1 | Documentation framework with MDX support | theme.config.tsx |
nextra-theme-docs | 3.3.1 | Pre-built documentation theme | theme.config.tsx |
@redocly/cli | 1.34.5 | OpenAPI validation and bundling | openapi/openapi.config.yaml |
cspell | 9.2.1 | Spell checking automation | cspell.json |
@sentry/react | 8.50.0 | Error tracking and monitoring | pages/_app.tsx |
@docsearch/react | 3.9.0 | Algolia search integration | components/Search/ |
sass | 1.92.1 | SCSS stylesheet compilation | pages/overrides.scss |
typescript | 5.9.3 | Type safety for components | tsconfig.json |
next-sitemap | 4.2.3 | Sitemap generation | next-sitemap.config.js |
Runtime Requirements:
>=20.0.0 <21.0.0>=10.0.0 <12.0.0Sources: package.json27-58 package-lock.json1-100
Directory Organization and Key Files
mixpanel/docs/
├── pages/ # Next.js pages and routing
│ ├── docs/ # Product documentation (500+ MDX files)
│ │ ├── _meta.tsx # Navigation structure configuration
│ │ ├── tracking/ # SDK implementation guides
│ │ ├── data-structure/ # Data model documentation
│ │ ├── features/ # Product feature docs
│ │ └── privacy/ # Privacy and compliance
│ ├── changelogs/ # Product update announcements
│ │ ├── _meta.tsx # Changelog navigation
│ │ └── *.mdx # Individual changelog posts
│ ├── guides/ # Tutorial content
│ ├── _app.tsx # Application wrapper (GTM, Mixpanel, Sentry)
│ ├── _document.js # HTML document structure
│ └── overrides.scss # Global theme styling (1500+ lines)
├── openapi/ # API documentation system
│ ├── src/ # OpenAPI YAML specifications
│ │ ├── ingestion.openapi.yaml # /track, /engage, /groups APIs
│ │ ├── query.openapi.yaml # Reports API
│ │ ├── export.openapi.yaml # Raw data export API
│ │ ├── data-pipelines.openapi.yaml
│ │ ├── lexicon-schemas.openapi.yaml
│ │ ├── feature-flags.openapi.yaml
│ │ ├── gdpr.openapi.yaml
│ │ └── common/ # Shared schemas and auth
│ ├── out/ # Bundled JSON output
│ ├── openapi.config.yaml # Redocly bundling config
│ └── publish.js # ReadMe publishing script
├── reference/ # API reference markdown pages
│ └── Mixpanel APIs/
│ └── overview.md
├── components/ # React components
│ ├── FeedbackCollector/ # User feedback widget
│ ├── Search/ # Custom search UI
│ └── ChangelogIndex.tsx # Changelog listing
├── redirects/ # URL redirect mappings
│ ├── local.txt # Internal redirects
│ ├── help-mixpanel-com.txt # Legacy help.mixpanel.com → docs.mixpanel.com
│ └── developer-mixpanel-com.txt # Legacy developer.mixpanel.com redirects
├── public/ # Static assets
│ ├── changelog/ # Changelog images and videos
│ └── *.png # Documentation screenshots
├── theme.config.tsx # Nextra theme configuration
├── next.config.mjs # Next.js build config, redirects
├── middleware.ts # Security headers, CSP
├── package.json # Dependencies and npm scripts
├── cspell.json # Spell checker configuration
└── README.md # Contributor guidelines
Key Configuration Files:
| File | Purpose | Key Sections |
|---|---|---|
theme.config.tsx | Nextra theme configuration | Logo, navigation, search, footer, social links |
next.config.mjs | Next.js build settings | Redirects (1000+ rules), image domains, output config |
middleware.ts | Request middleware | Content-Security-Policy, security headers |
openapi/openapi.config.yaml | API bundling configuration | 10+ API specs, output paths, linting rules |
pages/_app.tsx | Application initialization | GTM, Mixpanel tracking, Sentry, Sprig, Kapa AI |
cspell.json | Spell checking settings | Custom dictionary, ignored patterns |
Sources: README.md60-75 package.json1-60 openapi/openapi.config.yaml1-48
Build Process Architecture
npm Scripts and Their Functions
| Command | Script | Purpose |
|---|---|---|
npm run dev | next dev | Start development server with hot reload |
npm run build | next build | Generate production static site |
npm run start | next start | Serve production build locally |
npm run spelling | cspell '**/*.md*' | Validate spelling across MDX files |
npm run api:build | redocly bundle --config=./openapi/openapi.config.yaml | Bundle OpenAPI specs to JSON |
npm run api:lint | redocly lint --config=./openapi/openapi.config.yaml | Validate OpenAPI specifications |
npm run api:publish | node ./openapi/publish.js | Publish API docs to ReadMe platform |
npm test | ./utils/test.sh | Run test suite |
Deployment Workflow:
docs-git-branch-mixpanel.vercel.app)docs.mixpanel.com within 1-2 minutesnpm run api:publish or automated via GitHub ActionsSources: package.json5-16 README.md27-74 openapi/openapi.config.yaml1-48
Content Flow Through Build System
Content Type Documentation Map:
| Content Type | Source Location | Processing | Output Destination | Wiki Section |
|---|---|---|---|---|
| Product Docs | pages/docs/**/*.mdx | Nextra MDX processor | docs.mixpanel.com/docs/* | Section 4 |
| Changelogs | pages/changelogs/*.mdx | Nextra MDX processor | docs.mixpanel.com/changelogs/* | Section 2.3 |
| Guides | pages/guides/**/*.mdx | Nextra MDX processor | docs.mixpanel.com/guides/* | Section 4 |
| API Reference | openapi/src/*.yaml | Redocly bundler | developer.mixpanel.com | Section 3 |
| Static Assets | public/**/* | Next.js static file handling | CDN | Section 2.3 |
| Redirects | redirects/*.txt | Next.js middleware | HTTP 301/302 responses | Section 2.3 |
Supported API Specifications:
| Specification File | API Category | Output Bundle |
|---|---|---|
ingestion.openapi.yaml | Event tracking, profile updates | ingestion-api.json |
query.openapi.yaml | Reports and analytics queries | query-api.json |
export.openapi.yaml | Raw data export | event-export-api.json |
data-pipelines.openapi.yaml | Warehouse export configuration | data-pipelines-api.json |
lexicon-schemas.openapi.yaml | Data dictionary management | lexicon-schemas-api.json |
feature-flags.openapi.yaml | Feature flag evaluation | feature-flags-api.json |
gdpr.openapi.yaml | Data privacy compliance | gdpr-api-2.json |
Sources: openapi/openapi.config.yaml1-48 package.json5-16 next.config.mjs1-50
External Services Architecture
Integration Configuration Locations:
| Service | Configuration File | Purpose | Implementation Details |
|---|---|---|---|
| Google Tag Manager | pages/_app.tsx | Page view tracking, conversion events | GTM container ID: GTM-KV3FC2C |
| Mixpanel | pages/_app.tsx | Product analytics, dogfooding | Track page views, clicks, search queries |
| Sentry | pages/_app.tsx | Error monitoring, performance | DSN configured, release tracking enabled |
| Sprig | pages/_app.tsx | User surveys, feedback collection | Conditional loading based on environment |
| Kapa AI | theme.config.tsx | AI-powered search widget | Custom chat interface integration |
| Algolia DocSearch | theme.config.tsx | Documentation search | Index ID: mixpanel-docs |
| Intercom | theme.config.tsx | Live support chat | Conditional display for logged-in users |
| Content Security Policy | middleware.ts | Security headers | Defines allowed domains for scripts, images, frames |
Environment-Specific Loading:
Services are conditionally loaded based on NODE_ENV and custom feature flags to prevent tracking during development:
NODE_ENV=development): Analytics disabled, local-only featuresdocs.mixpanel.com): All integrations active, full tracking enabledSources: pages/_app.tsx1-100 theme.config.tsx1-200 middleware.ts1-16
This repository documents the complete Mixpanel product ecosystem across multiple product areas:
Product Documentation Organization:
| Product Area | Documentation Pages | Wiki Section | Primary File Locations |
|---|---|---|---|
| Client SDKs | JavaScript, iOS, Android, React Native, Flutter | Section 4.1 | pages/docs/tracking/ |
| Server SDKs | Python, Node.js, Java, PHP, Ruby | Section 4.1 | pages/docs/tracking/server/ |
| Session Replay | Web replay, mobile replay, privacy controls | Section 4.2 | pages/docs/session-replay/ |
| Data Model | Events, profiles, groups, lookup tables | Section 4.3 | pages/docs/data-structure/ |
| Billing & MTUs | Pricing plans, MTU calculation, plan limits | Section 4.4 | pages/docs/billing/ |
| Warehouse Connectors | Import from BigQuery, Snowflake, Databricks | Section 4.5 | pages/docs/data-pipelines/warehouse-connectors/ |
| Data Governance | Lexicon, data classification, access control | Section 4.6 | pages/docs/data-governance/ |
| Data Export | Raw export API, query API, data pipelines | Section 4.7 | pages/docs/export/ |
| Privacy & Security | GDPR, CCPA, data residency, encryption | Section 4.8 | pages/docs/privacy/ |
| Attribution | UTM tracking, referrer attribution | Section 4.9 | pages/docs/tracking/attribution/ |
API Documentation Coverage:
The repository maintains OpenAPI specifications for all Mixpanel APIs, documented in Section 3:
openapi/src/ingestion.openapi.yaml): /track, /engage, /groups endpointsopenapi/src/query.openapi.yaml): Reports, insights, funnels, retention queriesopenapi/src/export.openapi.yaml): Raw event data exportopenapi/src/data-pipelines.openapi.yaml): Warehouse export configurationopenapi/src/lexicon-schemas.openapi.yaml): Data dictionary managementopenapi/src/feature-flags.openapi.yaml): Variant assignment and evaluationopenapi/src/gdpr.openapi.yaml): Data deletion and retrievalSources: openapi/openapi.config.yaml1-48 reference/Mixpanel APIs/overview.md1-73
The system implements comprehensive security policies through Next.js middleware:
The middleware configuration in middleware.ts3-16 sets comprehensive Content Security Policy headers that restrict resource loading to approved domains while allowing necessary third-party integrations for analytics, support, and media embedding.
Sources: middleware.ts1-16
Refresh this wiki
This wiki was recently refreshed. Please wait 3 days to refresh again.