🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

@hexlet/analytics-plugin-dittofeed

Package Overview
Dependencies
Maintainers
3
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hexlet/analytics-plugin-dittofeed

Dittofeed plugin for DavidWells Analytics

latest
Source
npmnpm
Version
0.0.4
Version published
Weekly downloads
5
66.67%
Maintainers
3
Weekly downloads
 
Created
Source

Analytics Plugin for Dittofeed

Overview

Analytics plugin for analytics, powered by @dittofeed/sdk-web. Supports identify, track, and page methods.

Installation

npm i @hexlet/analytics-plugin-dittofeed

Usage

import Analytics from 'analytics';
import dittofeed from '@hexlet/analytics-plugin-dittofeed';

const analytics = Analytics({
  app: 'test-app',
  plugins: [
    dittofeed({
      sdkInit: {
        writeKey: 'Basic abcdefg...', // Public write key from Dittofeed dashboard
        // apiHost: 'https://app.dittofeed.com' // Can be overridden for self-host
      },
      enable: process.env.NODE_ENV === 'production', // Enable only in production
    }),
  ],
});

// page
analytics.page(); // page event (defaults with document.title)

// identify
analytics.identify('user_123', {
  email: 'user@example.com',
  firstName: 'John',
});

// track
analytics.track('Made Purchase', {
  itemId: 'abc123',
  price: 49.9,
});

Publishing

Releases are managed through release-it (see make release). The flow now publishes the package to both npm and GitHub Packages:

  • Ensure the build passes (npm run build).
  • Export authentication tokens before running the release command:
    export NPM_TOKEN=xxxx           # Token for registry.npmjs.org
    export NODE_AUTH_TOKEN=yyyy     # PAT for npm.pkg.github.com
    
    Optionally wire them in .npmrc:
    //registry.npmjs.org/:_authToken=${NPM_TOKEN}
    //npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}
    
  • Run make release (or npx release-it). This will build, publish to npm, then automatically run npm run publish:github which publishes the same tarball to https://npm.pkg.github.com.

Keywords

analytics

FAQs

Package last updated on 18 Nov 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