Socket
Book a DemoInstallSign in
Socket

@commandkit/analytics

Package Overview
Dependencies
Maintainers
2
Versions
216
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commandkit/analytics

Analytics providers for CommandKit

0.1.0-dev.20250605135449
latest
Source
npmnpm
Version published
Maintainers
2
Created
Source

@commandkit/analytics

Analytics providers for CommandKit.

Installation

npm install @commandkit/analytics

Usage

This package provides a commandkit plugin that automatically registers the analytics provider with the commandkit instance.

PostHog

import { posthog } from '@commandkit/analytics/posthog';

export default defineConfig({
  plugins: [
    posthog({
      posthogOptions: {
        apiKey: 'YOUR_POSTHOG_API_KEY',
        options?: PostHogOptions
      }
    })
  ],
});

Umami

import { umami } from '@commandkit/analytics/umami';

export default defineConfig({
  plugins: [
    umami({
      umamiOptions: {
        hostUrl: 'YOUR_UMAMI_HOST_URL',
        websiteId?: 'YOUR_UMAMI_WEBSITE_ID',
        sessionId?: 'YOUR_UMAMI_SESSION_ID',
        userAgent?: 'YOUR_UMAMI_USER_AGENT',
      }
    })
  ],
});

Tracking events

import { track } from 'commandkit/analytics';

await track({
  name: 'YOUR_EVENT_NAME',
  id?: 'YOUR_UNIQUE_ID',
  data: {...}
});

Disabling analytics per-request scope

The noAnalytics function can be used to disable analytics for a specific request. This can be useful if you want to disable analytics for a specific user or guild, etc.

import { noAnalytics } from 'commandkit/analytics';

// call inside command or event or middlewares
if (someCondition) {
  noAnalytics();
}

Keywords

commandkit

FAQs

Package last updated on 05 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.