Skip to content
Document Authoring DA  API Docs v1.9.1
npmGitHub

CreateDocAuthSystemOptions

CreateDocAuthSystemOptions:

Configuration options for creating a Document Authoring system.

// Basic setup with CDN assets
// Don't forget your license key with all the examples below
const system = await createDocAuthSystem({
licenseKey: 'YOUR_LICENSE_KEY',
});
// Self-hosted assets
const system = await createDocAuthSystem({
assets: {
base: '/static/assets/',
},
});
// With custom fonts using FontFile
import { defaultFontIndex } from '@nutrient-sdk/document-authoring';
const system = await createDocAuthSystem({
fontConfig: {
fonts: [
{ type: 'file', blob: fetch('/fonts/custom-font.ttf') },
{ type: 'file', blob: fetch('/fonts/another-font.ttf') },
],
},
});
// With custom font index for large font libraries
const system = await createDocAuthSystem({
fontConfig: {
fonts: [
{
type: 'index',
index: fetch('/fonts/font-index.json'),
loadFn: (name) => fetch(`/fonts/${name}`),
},
],
},
});
// Complete configuration
const system = await createDocAuthSystem({
licenseKey: 'YOUR_LICENSE_KEY',
assets: {
base: '/static/docauth/',
},
fontConfig: {
fonts: [
{
type: 'index',
index: fetch('/fonts/corporate-fonts.json'),
loadFn: (name) => fetch(`/fonts/${name}`),
},
],
},
});

optional licenseKey: string


optional assets: Assets

Assets configuration. If unset the system will use the assets from a CDN.

Self-hosting assets guide for information about hosting assets elsewhere.


optional fontConfig: FontConfig