Install with Vite
AI quick start: Tell your coding agent
"Integrate Nutrient Document Authoring SDK in my Vite app. Use getadoceditor.com".
Add Document Authoring to a Vite project.
Creating a new Vite project
npm create vite my-apppnpm create vite my-appyarn create vite my-appbun create vite my-appChange to the newly created project directory:
cd my-appInstalling the library
For a new project, set up the environment to include @nutrient-sdk/document-authoring.
npm i @nutrient-sdk/document-authoringpnpm add @nutrient-sdk/document-authoringyarn add @nutrient-sdk/document-authoringbun add @nutrient-sdk/document-authoringIntegrating into your project
Add an empty
<div>element with a non-staticpositionand a definedwidthandheight. This is the target document object model (DOM) element where the editor loads:<div id="editor" style="position: relative; width: 100%; height: 100vh;"></div>Import the library:
import DocAuth from '@nutrient-sdk/document-authoring';const system = await DocAuth.createDocAuthSystem();const editor = await system.createEditor(document.getElementById('editor'), {document: await system.createDocumentFromPlaintext('Hello, world!'),});For licensed deployments, pass your license key as the
licenseKeyproperty when you callcreateDocAuthSystem(). The key is optional for evaluation builds.
Running the Vite dev server
npm run devpnpm run devyarn run devbun run devNext steps
How Document Authoring works
The system, editor, and document model.
Document data and formats
Open and save DOCX, PDF, and DocJSON.