# Wingtics Provider-agnostic analytics widgets for React. One query model, six connectors — five providers plus a deterministic mock — and the same dashboard behind all of them. Site: https://wingtics.com Repo: https://github.com/educlopez/wingtics Docs: https://wingtics.com/docs Components: https://wingtics.com/components About: https://wingtics.com/about Contact: https://wingtics.com/contact Privacy: https://wingtics.com/privacy License: MIT ## When to use this Reach for Wingtics when a task is one of these: - Build or extend an analytics dashboard in a React or Next.js app, where the data lives in Vercel Web Analytics, Plausible, Google Analytics 4, Umami or PostHog. - Read website metrics without writing against one vendor's API, or migrate a dashboard from one of those providers to another without rewriting the charts. - Add a specific chart — funnel, cohort grid, globe, sankey, treemap, breakdown card, metric tabs — to an existing analytics view, either as an npm import or as owned source via the shadcn registry. - Keep analytics credentials off the client: `@wingtics/next` proxies a connector from a route handler so the token stays on the server. - Build a dashboard that degrades honestly across providers: connectors declare capabilities, and a widget the provider cannot answer says so instead of rendering zero. Do not reach for Wingtics when: - You need to *collect* analytics. It has no tracker, no script and no ingest endpoint; it only reads what a provider already holds. - You want a hosted dashboard. There is no service, no account and no API of ours to call — it is a component library you deploy yourself. - Your data is product analytics in a warehouse rather than website analytics behind one of the five supported providers. Writing a connector is possible, but there is no adapter to reuse. How to call it: install the packages below, construct one connector, wrap the tree in `AnalyticsProvider`, and render either `Dashboard` for the whole grid or individual components. Everything is typed; `useQuery` and `useCapabilities` are the two hooks worth knowing. ## Machine-readable - https://wingtics.com/llms.txt — this file - https://wingtics.com/sitemap.xml — every page - https://wingtics.com/openapi.json — the HTTP surface: the component registry and the analytics proxy contract, with operation ids, typed schemas and error codes - https://wingtics.com/r/registry.json — shadcn registry index - https://wingtics.com/r/{name}.json — one registry item - https://wingtics.com/api/v1/analytics — the analytics proxy this site runs against its own traffic. GET describes the connector and its capabilities; POST runs a query. ## API versioning and limits Pin `/api/v1/`. A change that breaks a caller becomes `/api/v2/`; the previous major keeps answering for at least 6 months from the day its successor ships, and carries `Deprecation: true` and a `Sunset` date on every response from that day. Additive changes happen in place, so parse defensively. `/api/analytics`, unversioned, is an alias that always tracks the newest major. It is not deprecated and is not going away — it is simply the wrong thing to pin, because it moves. Every response carries `RateLimit-Limit`, `RateLimit-Remaining`, `RateLimit-Reset` and `RateLimit-Policy`, so pace yourself before being refused rather than after. Over budget answers 429 with `Retry-After` and `"code": "RATE_LIMIT"`. The limit is 60 requests per 60 seconds per client address, counted per serving instance — treat it as a floor you can rely on, not a quota metered exactly. The index and the component pages also answer `Accept: text/markdown` with a markdown representation of the same content, and send `Vary: Accept` so a cache cannot mix the two: ```bash curl -H "Accept: text/markdown" https://wingtics.com/components/globe-chart ``` ## Install ```bash pnpm add @wingtics/react @wingtics/core @wingtics/next @wingtics/connector-vercel ``` Also: `@wingtics/connector-plausible`, `connector-ga4`, `connector-umami`, `connector-posthog`, `connector-mock`. Import `@wingtics/react/styles.css` once. Keep vendor tokens on the server. The browser talks to your own route — this site serves one at `/api/v1/analytics` — via `createHttpConnector`. ## Provider ```tsx import { AnalyticsProvider, Dashboard } from "@wingtics/react"; import { createVercelConnector } from "@wingtics/connector-vercel"; import "@wingtics/react/styles.css"; const connector = createVercelConnector({ token: process.env.VERCEL_TOKEN!, projectId: process.env.VERCEL_PROJECT_ID!, }); export function Stats() { return ( ); } ``` Server route: `createRouteHandlers({ connector })` from `@wingtics/next`. ## Query model Widgets never send vendor field names. They send a canonical `AnalyticsQuery`: ```ts await connector.query({ range: "7d", metrics: ["visitors", "pageviews"], dimensions: ["path"], granularity: "day", limit: 8, includePrevious: true, }); ``` Result: `totals`, `series`, `breakdown`, optional `previous.totals`. Hooks: `useQuery`, `useRealtime`, `useCapabilities`. If a connector cannot answer a metric, the widget renders an unsupported state. ## Charts `variant` is the drawing, not a color theme. Colors inherit `--chart-1`…`--chart-5` from the host. - AreaChart — gradient, linear, natural, step, dots, spark, dither, glow, hatched, bars, solid - LineChart — monotone, linear, step, dashed, dots, dither, glow, ping, rainbow, values - BarChart — vertical, horizontal, rounded, hatched, dither, glow, gradient, duotone - PieChart — donut, pie, legend, dither, rounded, radial, glow - FunnelChart — tape, steps, vertical - RadarChart — stroke, fill, glow, dither - ComposedChart — combo, highlight, overlay - GaugeChart — arc, ring, tick - ScatterChart — dots, bubble, glow - SankeyChart — flow, gradient, dither (nodes + links) - CandlestickChart — ohlc, hollow, wick - ChoroplethChart — tiles, heat, dither (region tiles, not a geoJSON map) - LiveLineChart — stream, glow, dashed - RingChart — stack, nested, track - HeatmapChart — calendar, matrix, dither - SunburstChart — nest, burst - ProfitLossChart — fill, stroke, bars - MetricCard — default, spark, compact, hero - RankedList — bar, compact, table Shared chart props: `data`, `dataKey`, `labelKey`, `variant`, `config`, `className`. ## Widgets `Dashboard` lays out registered widgets. `defaultDashboard` is the Vercel-friendly subset. `catalogDashboard` is every built-in. Ids: visitors, pageviews, visits, events, bounce-rate, duration, views-per-visit, realtime, timeseries, top-pages, top-referrers, top-countries, devices, top-browsers, top-os, top-sources, top-campaigns, top-events, pages-table, tracker. ## Colors No kit theme pack. Set host CSS variables: ```css :root { --chart-1: #1d779b; --chart-2: #297c3b; --chart-3: #c45c26; --chart-4: #7c6a4a; --chart-5: #5b4a8a; --card: #fff; --foreground: #1a1613; --primary: #1d779b; --border: #e3ddcf; } ``` ## shadcn registry ```bash pnpm dlx shadcn@latest add https://wingtics.com/r/dashboard.json ``` Every catalog chart plus `metric-card` and `dashboard`. GitHub: `educlopez/wingtics/dashboard`. ## Extend `defineConnector` and `defineWidget` are the extension points. See `examples/custom-connector.ts` and `examples/custom-widget.tsx`.