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:

FieldTrial value
maxHistoricalRows1,000 — the dataset is silently truncated to the first 1,000 rows
canExportfalse — the PDF export button is disabled
showWatermarktrue — 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

ts
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:

On the React entry, a trial license additionally locks:

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:

Titles and insights are written in Italian when the locale is Italian (numberFormat.locale or the locale option), English otherwise.

ts
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' }
FrameworkGenerate on loadGenerate 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

ts
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;
}