Licensing
Delegates every entitlement decision to a remote licensing server. The module contains no key-generation logic, no embedded secrets, and no locally-granted "enterprise" default — the safe default for any caller that omits credentials, or whose request fails, is a restricted trial tier.
The trial tier
Without a valid apiKey (or before the async check resolves), every dashboard runs at:
| Field | Trial value |
|---|---|
| maxHistoricalRows | 1,000 — the dataset is silently truncated to the first 1,000 rows |
| canExport | false — the PDF export button is disabled |
| showWatermark | true — a banner states the row cap and that export is off |
The row cap lives in DashboardStore itself, not in any one framework wrapper —
so it applies identically whether you're using React, Vue, Angular, or the custom element.
A dashboard always starts at this safe default and only loosens once a license check
actually resolves successfully; a slow or failed check never lets more rows through.
Checking a license
import { checkLicense } from '@datastripes/dashboard';
const license = await checkLicense({ apiKey: 'ds_live_...' });
// { isValid, plan, maxHistoricalRows, canExport, showWatermark, ... }
store.setLicense(license); // re-caps the dataset and re-renders
Every framework wrapper does this automatically from its apiKey prop/attribute —
you only need to call it yourself if you're driving DashboardStore directly (see
DashboardStore).
Gated features
On every entry (React, Vue, Angular, custom element), a trial (invalid) license locks:
-
Auto-dashboard — the "Auto-dashboard" button is shown with a lock, and
generateDashboardConfig()/store.autoGenerate()refuse to run (see below).
On the React entry, a trial license additionally locks:
- PDF export — the toolbar button is disabled with a lock icon.
- 11 of the 30 chart types — the Distribution group (histogram, heatmap, calendar heatmap, box plot), Relationships & flow (network graph, Sankey, parallel coordinates), and Specialized (gauge, progress ring, funnel, candlestick) are shown disabled in the chart-type picker.
- New calculated fields — existing ones remain visible and usable; the "Add calculated field" control is disabled.
Everyday chart types (line, area, streamgraph, bar, bar + line, waterfall, pie, donut, treemap, sunburst, tree, scatter, radar, …) remain available on trial — a free user can still build a full dashboard by hand.
Auto-dashboard (licensed)
Builds a complete dashboard from a raw dataset in one call — no LLM, no server, deterministic. Every column is profiled over the full dataset (type, cardinality, nulls, spread, date cadence), classified as a metric, a grouping, a time axis or an identifier, and then:
- KPI row — up to 4 headline metrics with the right aggregation (totals are summed, rates and prices averaged), currency/percentage formatting, an icon, and a trend sparkline with "vs previous period" when there's a time axis.
- Charts — up to 8, picked by score with a diversity rule so you get different angles: time trend (hero), bar + line combo, breakdowns, share (donut/treemap), funnel for stage-like fields, stacked bar / heatmap / sunburst for two groupings, scatter or bubble for the strongest correlation, histogram, calendar heatmap for daily data, progress ring for rates.
- Filters — a date range plus up to two multi-selects, linked to every widget (click-to-filter works on the generated charts).
- Insights — a narrative panel: period-over-period change on well-covered periods only, leader and concentration, top average, correlation, outliers, missing data.
- Data table — the raw rows with per-column formats, sorting and quick filter.
Titles and insights are written in Italian when the locale is Italian (numberFormat.locale or the locale option), English otherwise.
import { generateDashboardConfig, isAutoDashboardAvailable } from '@datastripes/dashboard';
const license = await checkLicense({ apiKey: 'ds_live_...' });
if (isAutoDashboardAvailable(license)) {
const { config, insights } = generateDashboardConfig(rows, license, { locale: 'it-IT', maxCharts: 6 });
}
// Or on a mounted dashboard (keeps theme / number format / layout settings):
store.autoGenerate(); // → { ok: true, insights } | { ok: false, reason: 'license' }
| Framework | Generate on load | Generate on demand |
|---|---|---|
| React | <DatastripesDashboard autoGenerate /> | toolbar "Auto-dashboard" button |
| Vue | <DatastripesDashboard auto-generate /> | header button, or ref.autoGenerate() |
| Angular | [autoGenerate]="true" | header button, or component.triggerAutoGenerate() |
| Custom element | <datastripes-dashboard auto-generate> | header button, or el.autoGenerate() |
"Generate on load" only runs when the dashboard has no widgets yet, so it never overwrites a
saved config. Each successful run emits an auto_generate action
(onAction / @action / (action) / ds-action).
LicenseValidationResult
interface LicenseValidationResult {
isValid: boolean;
licenseKey: string;
domain: string;
isHostMatch: boolean;
isExpired: boolean;
expiresAt: string | null;
plan: 'trial' | 'pro' | 'enterprise';
customerName?: string;
maxHistoricalRows: number; // Infinity on a valid license
canExport: boolean;
showWatermark: boolean;
tamperDetected: boolean;
hashDigest: string;
}