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

@databuddy/sdk

v2.3.28

Published

Official Databuddy Analytics SDK

Readme

Databuddy SDK & React Component

npm version License Docs

The easiest, privacy-first way to add analytics to your web app.


✨ Features

  • 📊 Automatic page/screen view tracking
  • Performance, Web Vitals, and error tracking
  • 🧑‍💻 Custom event tracking
  • 🧩 Drop-in React/Next.js component: <Databuddy />
  • 🛡️ Privacy-first: anonymized by default, sampling, batching, and more
  • 🛠️ Type-safe config and autocompletion
  • 📋 Observability: logging, error tracking, and distributed tracing

🚀 Quickstart

bun add @databuddy/sdk
# or
npm install @databuddy/sdk

Add to your root layout (Next.js/React):

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

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <head />
      <Databuddy
        clientId={process.env.NEXT_PUBLIC_DATABUDDY_CLIENT_ID!}
        trackPerformance
        trackWebVitals
        trackErrors
        enableBatching
        batchSize={20}
      />
      <body>{children}</body>
    </html>
  );
}

🛠️ Configuration Options

All options are type-safe and documented in DatabuddyConfig:

| Option | Type | Default | Description | |-----------------------|-----------|--------------|-------------| | clientId | string | — | Required. Your Databuddy project client ID. | | clientSecret | string | — | (Advanced) For server-side use only. | | apiUrl | string | https://basket.databuddy.cc | Custom API endpoint. | | scriptUrl | string | https://cdn.databuddy.cc/databuddy.js | Custom script URL. | | sdk | string | web | SDK name. Only override for custom builds. | | sdkVersion | string | auto | SDK version. Defaults to package version. | | disabled | boolean | false | Disable all tracking. | | debug | boolean | false | Enable debug logging (SDK-only). | | trackHashChanges | boolean | false | Track hash changes in URL. | | trackAttributes | boolean | false | Track data-* attributes on elements. | | trackOutgoingLinks | boolean | false | Track clicks on outgoing links. | | trackInteractions | boolean | false | Track user interactions. | | trackScrollDepth | boolean | false | Track scroll depth. | | trackPerformance | boolean | true | Track page performance metrics. | | trackWebVitals | boolean | false | Track Web Vitals metrics. | | trackErrors | boolean | false | Track JavaScript errors. | | ignoreBotDetection | boolean | false | Ignore bot detection. | | usePixel | boolean | false | Use pixel tracking instead of script. | | samplingRate | number | 1.0 | Sampling rate (0.0–1.0). | | enableRetries | boolean | false | Enable retries for failed requests. | | maxRetries | number | 3 | Max retries. | | initialRetryDelay | number | 500 | Initial retry delay (ms). | | enableBatching | boolean | true | Enable event batching. | | batchSize | number | 10 | Events per batch (1–50). | | batchTimeout | number | 5000 | Batch timeout (ms, 100–30000). | | skipPatterns | string[] | — | Array of glob patterns to skip tracking. | | maskPatterns | string[] | — | Array of glob patterns to mask sensitive paths. | | filter | function | — | Filter function to conditionally skip events. |


💡 FAQ

Q: Is Databuddy privacy-friendly?
A: Yes! All analytics are anonymized by default. No cookies, no fingerprinting, no PII.

Q: Can I use this in Next.js, Remix, or plain React?
A: Yes! <Databuddy /> works in any React app. For non-React, use the script tag directly.

Q: How do I disable analytics in development?
A: Use the disabled prop: <Databuddy disabled={process.env.NODE_ENV === 'development'} ... />

Q: Where do I find my clientId?
A: In your Databuddy dashboard.


🧑‍💻 Troubleshooting

  • Script not loading?
    • Make sure your clientId is correct and the script URL is reachable.
  • No events in dashboard?
    • Check your config, especially clientId and network requests in the browser dev tools.
  • Type errors?
    • All config options are type-safe. Use your IDE's autocomplete for help.
  • SSR/Next.js?
    • The component is safe for SSR/React Server Components. It only injects the script on the client.

📚 Documentation & Support


© Databuddy. All rights reserved.