0
0
Source

Integrate Databuddy analytics into applications using the SDK or REST API. Use when implementing analytics tracking, feature flags, custom events, Web Vitals, error tracking, LLM observability, or querying analytics data programmatically.

Install

mkdir -p .claude/skills/databuddy && curl -L -o skill.zip "https://mcp.directory/api/skills/download/4882" && unzip -o skill.zip -d .claude/skills/databuddy && rm skill.zip

Installs to .claude/skills/databuddy

About this skill

Databuddy

Databuddy is a privacy-first analytics platform. This skill covers both the SDK (@databuddy/sdk) and the REST API.

External Documentation

For the most up-to-date documentation, fetch: https://databuddy.cc/llms.txt

When to Use This Skill

Use this skill when:

  • Setting up analytics in React/Next.js/Vue applications
  • Implementing server-side tracking in Node.js
  • Adding feature flags to an application
  • Tracking custom events, errors, or Web Vitals
  • Integrating LLM observability with Vercel AI SDK
  • Querying analytics data via the REST API or MCP
  • Building MCP agents or AI-powered analytics workflows
  • Building custom dashboards or reports

SDK Entry Points

Import PathEnvironmentDescription
@databuddy/sdkBrowser (Core)Core tracking utilities and types
@databuddy/sdk/reactReact/Next.jsReact component and hooks
@databuddy/sdk/nodeNode.js/ServerServer-side tracking with batching
@databuddy/sdk/vueVue.jsVue plugin and composables
@databuddy/sdk/ai/vercelAI/LLMVercel AI SDK middleware for LLM analytics

Quick Start

React/Next.js

import { Databuddy } from "@databuddy/sdk/react";

export default function RootLayout({ children }) {
  return (
    <html>
      <body>
        {children}
        <Databuddy
          clientId={process.env.NEXT_PUBLIC_DATABUDDY_CLIENT_ID}
          trackWebVitals
          trackErrors
          trackPerformance
        />
      </body>
    </html>
  );
}

Node.js Server-Side

import { Databuddy } from "@databuddy/sdk/node";

const client = new Databuddy({
  clientId: process.env.DATABUDDY_CLIENT_ID,
  enableBatching: true,
});

await client.track({
  name: "api_call",
  properties: { endpoint: "/users", method: "GET" },
});

// Important: flush before process exit in serverless
await client.flush();

Feature Flags

import { FlagsProvider, useFlag, useFeature } from "@databuddy/sdk/react";

// Wrap your app
<FlagsProvider clientId="..." user={{ userId: "123" }}>
  <App />
</FlagsProvider>

// In components
function MyComponent() {
  const { on, loading } = useFeature("dark-mode");
  if (loading) return <Skeleton />;
  return on ? <DarkTheme /> : <LightTheme />;
}

LLM Analytics

import { databuddyLLM } from "@databuddy/sdk/ai/vercel";
import { openai } from "@ai-sdk/openai";

const { track } = databuddyLLM({
  apiKey: process.env.DATABUDDY_API_KEY,
});

const model = track(openai("gpt-4o"));
// All LLM calls are now automatically tracked

Key Configuration Options

OptionTypeDefaultDescription
clientIdstringAuto-detectProject client ID
disabledbooleanfalseDisable all tracking
trackWebVitalsbooleanfalseTrack Web Vitals metrics
trackErrorsbooleanfalseTrack JavaScript errors
trackPerformancebooleantrueTrack performance metrics
enableBatchingbooleantrueEnable event batching
samplingRatenumber1.0Sampling rate (0.0-1.0)
skipPatternsstring[]Glob patterns to skip tracking

Common Patterns

Disable in Development

<Databuddy
  disabled={process.env.NODE_ENV === "development"}
  clientId="..."
/>

Skip Sensitive Paths

<Databuddy
  clientId="..."
  skipPatterns={["/admin/**", "/internal/**"]}
  maskPatterns={["/users/*", "/orders/*"]}
/>

Custom Event Tracking

// Browser
import { track } from "@databuddy/sdk/react";

track("purchase", {
  product_id: "sku-123",
  amount: 99.99,
  currency: "USD",
});

// Node.js
await client.track({
  name: "subscription_renewed",
  properties: { plan: "pro", amount: 29.99 },
});

Global Properties

// Browser
window.databuddy?.setGlobalProperties({
  plan: "enterprise",
  abVariant: "checkout-v2",
});

// Node.js
client.setGlobalProperties({
  environment: "production",
  version: "1.0.0",
});

REST API

Base URLs

ServiceURLPurpose
Analytics APIhttps://api.databuddy.cc/v1Query analytics data
Event Trackinghttps://basket.databuddy.ccSend custom events

Authentication

Use API key in the x-api-key header:

curl -H "x-api-key: dbdy_your_api_key" \
  https://api.databuddy.cc/v1/query/websites

Get API keys from: Dashboard → Organization Settings → API Keys

Query Analytics Data

curl -X POST -H "x-api-key: dbdy_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "parameters": ["summary", "pages"],
    "preset": "last_30d"
  }' \
  "https://api.databuddy.cc/v1/query?website_id=web_123"

Available Query Types:

TypeDescription
summaryOverall website metrics and KPIs
pagesPage views and performance by URL
trafficTraffic sources and referrers
browser_nameBrowser usage breakdown
device_typesDevice category breakdown
countriesVisitors by country
errorsJavaScript errors
performanceWeb vitals and load times
custom_eventsCustom event data

Date Presets: today, yesterday, last_7d, last_30d, last_90d, this_month, last_month

MCP (Model Context Protocol)

Databuddy exposes an MCP server for AI agents (Cursor, Claude Desktop, etc.) to query analytics. Use for natural-language questions, automated reports, or structured data extraction.

Endpoint: POST https://api.databuddy.cc/v1/mcp (local: http://localhost:3001/v1/mcp)

Auth: API key with read:data scope via x-api-key or Authorization: Bearer <key>

Tools:

  • ask – Natural-language analytics questions (e.g. "top 5 pages last week")
  • list_websites – List accessible website IDs
  • get_data – Pre-built query with websiteId, type, and preset or from/to
  • get_schema – ClickHouse schema docs (tables, columns)
  • capabilities – Query types with descriptions, date presets, hints

Date presets for get_data: last_7d, last_30d, last_90d, today, yesterday, this_week, this_month, etc.

Cursor setup (mcp.json): Add a Databuddy MCP entry with the API URL and your API key.

Send Events via API

curl -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "type": "custom",
    "name": "purchase",
    "properties": {
      "value": 99.99,
      "currency": "USD"
    }
  }' \
  "https://basket.databuddy.cc/?client_id=web_123"

Batch Events

curl -X POST \
  -H "Content-Type: application/json" \
  -d '[
    {"type": "custom", "name": "event1", "properties": {...}},
    {"type": "custom", "name": "event2", "properties": {...}}
  ]' \
  "https://basket.databuddy.cc/batch?client_id=web_123"

Reference Documentation

For detailed documentation, see:

Source Code

  • SDK: packages/sdk/
  • API: apps/api/
  • API Docs: apps/docs/content/docs/api/

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

641968

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

590705

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

339397

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

318395

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

450339

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

304231

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.