@smart-grid/enterprise
v1.2.0
Published
Enterprise feature modules and license helpers for Smart Grid.
Downloads
367
Maintainers
Readme
@smart-grid/enterprise
Monorepo / npm release 1.2.0 (stable 1.x); depends on
@smart-grid/core ^1.2.0.
What's new in 1.2.0
- Aligns with core 1.2.0 (
GridOptionscolumn UX flags). No breaking API changes to licence helpers. - Demo key Acme Labs documents partial
modulesallowlist (useisFeatureAllowed/flagsbefore calling enterprise APIs). See CHANGELOG.md.
Optional enterprise layer for Smart Grid: license registration, feature assertions, and a curated EnterpriseFeatures object that mirrors helpers from @smart-grid/core (AI insight, charting, clipboard, Excel, grouping, pivot, tree, master/detail, menus, …).
On Angular, bind enterpriseLicenseKey on <smart-grid> (from @smart-grid/angular) to gate enterprise UI inputs using the same JSON allowlist. Use this package directly for registerEnterpriseLicense, assertEnterpriseFeature, and app-level EnterpriseFeatures calls.
Live demo & docs: https://smart-grid-mu.vercel.app/
A small
predefined-licenses.jsonships demo keys for tests and local development. Replace with your own entitlement service for production.
Install
npm install @smart-grid/enterprise @smart-grid/coreUsage — register and assert
import {
registerEnterpriseLicense,
assertEnterpriseFeature,
EnterpriseFeatures
} from "@smart-grid/enterprise";
// After your checkout / SSO flow resolves a license object:
registerEnterpriseLicense({
key: "your-signed-or-opaque-key",
owner: "Acme Corp",
expiresAt: "2027-01-01"
});
// Before calling code paths you consider "enterprise only":
assertEnterpriseFeature("ai-toolkit"); // throws if no license registered
const insight = EnterpriseFeatures.ai(
[{ revenue: 50 }],
[{ field: "revenue", headerName: "Revenue", sortable: true }],
"Summarize revenue"
);
console.log(insight);AI Toolkit is preview / API-only:
EnterpriseFeatures.aicalls the heuristiccreateAiGridInsighthelper in core (no LLM). The feature matrix marks it as Preview (API only) until a full LLM-backed toolkit ships.
Usage — predefined demo keys (tests / demos)
import { registerEnterpriseLicenseFromPredefinedKey } from "@smart-grid/enterprise";
const ok = registerEnterpriseLicenseFromPredefinedKey(process.env.DEMO_LICENSE_KEY ?? "");
if (!ok) {
console.warn("No matching predefined license");
}Use findPredefinedEnterpriseLicense and isPredefinedLicenseNotExpired when you need to validate keys without registering yet.
API (selected)
| Export | Role |
| --- | --- |
| registerEnterpriseLicense | Store the active license in memory. |
| getEnterpriseLicense | Read the active license (or null). |
| assertEnterpriseFeature | Throws if no license; feature id matches enterpriseFeatures from core. |
| registerEnterpriseLicenseFromPredefinedKey | Registers when key matches shipped JSON and is not expired. |
| EnterpriseFeatures | Namespaced re-exports for charts, Excel, grouping, etc. |
| PREDEFINED_ENTERPRISE_LICENSES | Read-only list of demo licenses. |
Related packages
@smart-grid/core@smart-grid/mcp-server— MCP-oriented helpers (separate from licensing)
Links
- Homepage / demo: smart-grid-mu.vercel.app
- Repository: github.com/rajkishorsahu89/smart-grid
- Issues: github.com/rajkishorsahu89/smart-grid/issues
