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 apositionset to a value other thanstatic, and with a definedwidthandheight. This will be the target document object model (DOM) element where the editor will be loaded:<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!'),});
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.
Working with documents
Open and save DOCX, PDF, and DocJSON.