Introduction

Code-first analytics for product and growth teams

Realanalytics keeps event definitions, dashboard configuration, and deployment in your codebase. You define analytics in TypeScript, ship changes through Git, and deploy with the CLI.

How it works

  1. Define events in analytics/events.ts
  2. Define dashboards in analytics/dashboards/*.ts
  3. Deploy with npx realanalytics deploy

Example dashboard definition

import { defineDashboard, widget, controls } from '@realanalytics/sdk'

export default defineDashboard({
  id: 'overview',
  title: 'Overview',
  defaultDateRange: 'last_30_days',
  controls: [
    controls.dateRange({ editable: true }),
    controls.filter({ editable: true }),
  ],
  widgets: [
    widget.metric({
      id: 'signups',
      label: 'Signups',
      event: 'signup_completed',
      aggregation: 'count',
    }),
    widget.timeSeries({
      id: 'traffic',
      title: 'Traffic',
      event: '$pageview',
      metric: 'count',
      chartType: 'area',
    }),
  ],
})

What you get

  • Type-safe config for events and dashboards
  • Built-in autocapture for page views, clicks, forms, and more
  • Simple deploy flow from local dev or CI

Next Steps