Skip to content

API reference / @docmentis/udoc-node / UDocNodeOptions

Interface: UDocNodeOptions ​

What the engine is told about who is running it, under what license, and which fonts it may draw with beyond a document's own. Every session started through the same UDocNode carries it.

Properties ​

PropertyDescription
license?
string
Commercial license key. Absent is free usage, which is metered: every UDocNode.open then needs a permit from the docMentis service.
domain?
string
The domain the license is issued for. A browser host has a page to read it from and a Node host does not, so here it is declared. Defaults to "unknown".
disableTelemetry?
boolean
Ask for usage not to be reported. Honored only with a license; otherwise ignored.
distinctId?
string
Anonymous per-user id, so usage attributes to one user across sessions. Without one, usage attributes to the domain.
wrapper?
{ name: string; version: string; }
The docMentis component embedding the engine, reported with every permit request and usage event. Defaults to this package; udoc-cli and udoc-server name themselves.
fonts?
readonly ( | Uint8Array<ArrayBufferLike> | UrlFont)[]
Fonts of the host's own, offered to every document — each a font file's bytes or a UrlFont, fetched once a document's text asks for it; a file: URL is read from disk. Default none.
enableGoogleFonts?
boolean
Fetch from Google Fonts the families a document names that no font of its own or the host's (fonts) covers. false offers no Google font family at all, so nothing is ever asked of Google. Default true.
googleFontFamilies?
GoogleFontFamily[]
The Google font families offered, each its name, the [bold, italic] faces Google serves for it and its subsets — to narrow the catalog @docmentis/udoc-wasm ships (GOOGLE_FONT_CATALOG), extend it or keep it current. Ignored when enableGoogleFonts is false. Default that catalog.
googleFontEndpoint?
string | URL
Where the Google Fonts css2 API is asked for a family's faces — a mirror's, for a host that can't or won't reach Google. The font files are fetched from the URLs its @font-face blocks give, so a mirror that also stands in for fonts.gstatic.com rewrites them. An absolute URL. Ignored when enableGoogleFonts is false. Default https://fonts.googleapis.com/css2.
fontCacheSize?
number
Bytes of downloaded font files kept for every session to reuse — a Google font's files and each UrlFont fetched over the network — the least recently used dropped first. 0 keeps none. Default 64 MiB.