@richhtmleditor/enterprise
v1.2.9
Published
Licence and feature-gate helpers for Rich HTML Editor enterprise deployments.
Maintainers
Readme
@richhtmleditor/enterprise
Licence verification and feature gating for self-hosted Rich HTML Editor deployments. Resolves signed DE1.* tokens and predefined demo keys into @richhtmleditor/core EditorFeatureFlags for AI, comments, workflows, and the full toolbar preset.
Current release: 1.2.9 — Depends on @richhtmleditor/core ^1.2.9.
Repository: github.com/rajkishorsahu89/richhtmleditor
Demo: richhtmleditor.stackkitlabs.com — demo · guide · API. Doc Preview joint demo: doc-preview-app.vercel.app/demo/enterprise
What's in 1.2.9
resolveEnterpriseFeatures— verify signed tokens or predefined demo keys; returnsEditorFeatureFlags- Predefined demo keys —
RHE-ENT-DEMO-2026-FULL,RHE-ENT-DEMO-2026-COMMENTS(seepredefined-licenses.json) - Signed tokens —
DE1.<base64url(payload)>.<hmac-sha256>minted withcreateEnterpriseLicenceToken @richhtmleditor/enterprise/browser— browser-safe entry (predefined keys only, noprocess.env)- Online verification —
resolveEnterpriseFeaturesOnlinefor remote licence checks
Use the main export on your server (Node) with
DE_LICENCE_SECRET. Use/browserin client bundles for demo keys only.
Keywords: richhtmleditor enterprise licence feature-flags licensing
Install
npm install @richhtmleditor/enterprise
# Requires @richhtmleditor/core (pulled in by framework wrappers).Usage — server-side verification
import { createEditor } from "@richhtmleditor/core";
import { resolveEnterpriseFeatures } from "@richhtmleditor/enterprise";
const gate = resolveEnterpriseFeatures(
{ token: process.env.DE_LICENCE! },
{ secret: process.env.DE_LICENCE_SECRET! }
);
const editor = createEditor({
element: host,
features: gate.features,
toolbar: gate.features.toolbarFull ? { preset: "full" } : { preset: "standard" }
});Usage — browser (demo keys)
import { resolveEnterpriseFeatures } from "@richhtmleditor/enterprise/browser";
const gate = resolveEnterpriseFeatures({ token: "RHE-ENT-DEMO-2026-FULL" });
// gate.valid === true
// gate.features — { ai: true, comments: true, workflows: true, toolbarFull: true, … }Usage — mint signed tokens
import { createEnterpriseLicenceToken } from "@richhtmleditor/enterprise";
const token = createEnterpriseLicenceToken(
{
sub: "acme-corp",
exp: Math.floor(Date.now() / 1000) + 86400,
features: { ai: true, comments: true, workflows: true, toolbarFull: true }
},
process.env.DE_LICENCE_SECRET!
);
// Returns "DE1.<payload>.<signature>"Set DE_LICENCE_SECRET in your deployment environment. Payload exp is a Unix timestamp (seconds).
Token formats
| Format | Example | Where verified |
| --- | --- | --- |
| Predefined demo key | RHE-ENT-DEMO-2026-FULL | Server or /browser |
| Signed token | DE1.eyJ…}.a1b2c3… | Server with DE_LICENCE_SECRET |
Demo keys (documentation only)
| Key | Features |
| --- | --- |
| RHE-ENT-DEMO-2026-FULL | AI, comments, workflows, toolbarFull |
| RHE-ENT-DEMO-2026-COMMENTS | Comments only |
API
| Export | Description |
| --- | --- |
| resolveEnterpriseFeatures(licence?, options?) | Verify token; merge into EditorFeatureFlags. |
| createEnterpriseLicenceToken(payload, secret) | Mint a signed DE1.* token (server-side). |
| verifySignedLicenceToken(token, secret, now?) | Low-level token verification. |
| DEFAULT_ENTERPRISE_FEATURES | Base flags when no licence is valid. |
| PREDEFINED_ENTERPRISE_LICENSES | Built-in demo key catalogue. |
| mergeEnterpriseFeatures(base, overrides?) | Merge partial feature overrides. |
| resolveEnterpriseFeaturesOnline(options) | Remote licence verification. |
EnterpriseGateResult
| Field | Type | Description |
| --- | --- | --- |
| valid | boolean | Whether the licence was accepted. |
| features | EditorFeatureFlags | Resolved feature flags for createEditor. |
| message | string? | Human-readable status. |
| subject | string? | Licence subject / owner. |
Default feature flags
| Flag | Default (no licence) |
| --- | --- |
| tables | true |
| media | true |
| collapsible | true |
| comments | false |
| ai | false |
| workflows | false |
| toolbarFull | false |
Related packages
@richhtmleditor/core— consumesEditorFeatureFlags.@richhtmleditor/ai— requiresfeatures.ai.@richhtmleditor/comments— requiresfeatures.comments.@richhtmleditor/workflows— requiresfeatures.workflows.@richhtmleditor/angular— Angular wrapper.@richhtmleditor/react— React wrapper.
