npm.io
2.22.7 • Published 4d ago

@medusajs/analytics-local

Licence
MIT
Version
2.22.7
Deps
0
Size
10 kB
Vulns
0
Weekly
0
Stars
36.6K

Medusa logo

@medusajs/analytics-local

Documentation | Website

Building blocks for digital commerce

Medusa is released under the MIT license. PRs welcome! Discord Chat Follow @medusajs

Local Analytics Module Provider for Medusa: logs analytics track and identify calls to the Medusa logger at debug level instead of sending them to a third-party service. Use it in development to see which analytics events your application emits. It ships with @medusajs/medusa and is registered through the @medusajs/medusa/analytics-local path.

At a glance

Package @medusajs/analytics-local
Type Module Provider (Analytics Module)
Provider ID analytics-local
Registered by default No
Import from @medusajs/medusa/analytics-local

Installation

No installation needed. The provider is a dependency of @medusajs/medusa.

Usage

Register the provider in the Analytics Module's providers array in medusa-config.ts. The Analytics Module accepts exactly one provider.

import { defineConfig } from "@medusajs/framework/utils"

module.exports = defineConfig({
  // ...
  modules: [
    {
      resolve: "@medusajs/medusa/analytics",
      options: {
        providers: [
          {
            resolve: "@medusajs/medusa/analytics-local",
            id: "local",
          },
        ],
      },
    },
  ],
})

Events are logged at the debug level, so set your log level accordingly to see them.

Configuration

The provider has no options.

Resources

Keywords