@pinelab/vendure-plugin-metrics
Version:
Vendure plugin measuring and visualizing e-commerce metrics
36 lines (35 loc) • 1.3 kB
TypeScript
import { AdminUiExtension } from '@vendure/ui-devkit/compiler';
import { RequestContext } from '@vendure/core';
import { MetricStrategy } from './services/metric-strategy';
export interface MetricsPluginOptions {
/**
* The enabled metrics shown in the widget.
*/
metrics: MetricStrategy[];
/**
* The number of past months to display in the metrics widget.
* If your shop has a lot of orders, consider using only the last 3 months for example.
*/
displayPastMonths: number;
/**
* The plugin will automatically remove request logs older than this number of months.
* The default is 24 months.
*/
removeRequestLogsOlderThanMonths: number;
/**
* Optional: decide wether to log a request or not.
* By default all requests to `pageVisit` are logged.
*/
shouldLogRequest?: (ctx: RequestContext) => boolean;
/**
* Use to aggregate visits: multiple requests from the same user
* within a certain time frame are grouped into a single visit.
* The default is 30 minutes.
*/
sessionLengthInMinutes: number;
}
export declare class MetricsPlugin {
static options: MetricsPluginOptions;
static init(options: Partial<MetricsPluginOptions>): typeof MetricsPlugin;
static ui: AdminUiExtension;
}