Documentation Index
Fetch the complete documentation index at: https://mintlify.com/R0N7w7/OnlyOfficeControl/llms.txt
Use this file to discover all available pages before exploring further.
Configuration Object Structure
The configuration object passed toOnlyOfficeEditorModule.init() follows the OnlyOffice Document Server API specification with additional module-specific handling.
Basic Structure
Document Configuration
Defines the document to be opened in the editor.The file extension/type:
'docx', 'xlsx', 'pptx', 'pdf', etc.Unique document identifier. Must change when document content changes. Used for caching and collaboration.
Document title displayed in the editor.
Absolute URL to the document file. Must be accessible by OnlyOffice Document Server.
Document permissions object controlling what users can do.
Example: Complete Document Config
Document Type
Specifies the type of editor to use.The editor type:
'word', 'cell', or 'slide'.'word': Document editor (doc, docx, txt, etc.)'cell': Spreadsheet editor (xls, xlsx, csv, etc.)'slide': Presentation editor (ppt, pptx, etc.)
Editor Configuration
Controls editor behavior, appearance, and user settings.Mode
Editor mode:
'edit' or 'view'. Defaults to 'edit'.Language
Interface language code (e.g.,
'en', 'es', 'fr').User Information
Information about the current user for collaboration features.
Callback URL
Server endpoint for saving document changes. OnlyOffice Document Server will POST updates to this URL.
Customization Options
TheeditorConfig.customization object controls the editor’s appearance and behavior. OnlyOfficeEditorModule applies default values automatically.
Default Customization Values
The module sets these defaults if not specified:UI Theme
Color theme for the editor interface.Options:
'theme-classic-light': Light theme (default)'theme-light': Modern light theme'theme-dark': Dark theme
Toolbar Options
Use compact toolbar layout.
Hide tabs in the toolbar.
Hide the file name in the toolbar.
UI Elements Visibility
Hide the right sidebar menu. Set to
false to show object properties, comments, etc.Hide rulers in document editor.
Review/Track Changes
Show tracked changes panel on load.
The module automatically migrates the deprecated
showReviewChanges property to review.showReviewChanges.Other Customization Options
OnlyOfficeEditorModule doesn’t modify these, but they’re supported:Enable/disable chat feature.
Enable/disable comments.
Initial zoom level (percentage).
Enable/disable autosave.
Enable force save mode.
Complete Customization Example
Events
Theconfig.events object is managed internally by OnlyOfficeEditorModule. Instead of configuring events directly, use the options parameter.
Module Event Callbacks
Pass callbacks through theoptions parameter of init():
Called when the editor application is initialized and ready to use.Maps to: OnlyOffice
onAppReady eventCalled when the document has been fully loaded in the editor.Maps to: OnlyOffice
onDocumentReady eventCalled when an error occurs in the editor.Maps to: OnlyOffice
onError eventParameters:event: Error event object with details
Internal Events
These events are handled internally by the module:- onDownloadAs: Triggered when document download completes (used by
getEditedDocumentUrl()) - onAppReady: Hides loading indicator and calls
options.onReady
Event Flow Example
Dimensions
Control the editor size:Editor height with CSS unit.
Editor width with CSS unit.
Editor Type
Platform type:
'desktop' or 'mobile'.Proxy Configuration
ForgetEditedDocumentBlob() to work with cross-origin restrictions:
Proxy Implementation Example (ASP.NET)
Complete Configuration Example
Best Practices
Document Keys
Always generate unique keys for each document version. Include version numbers or timestamps.
Error Handling
Always provide
onError callback to handle initialization and runtime errors gracefully.Permissions
Set appropriate permissions based on user roles to control editing, downloading, and printing.
Customization
Test different UI themes and toolbar configurations to match your application’s design.
See Also
- Module Methods - Detailed method documentation
- Overview - JavaScript API overview
- OnlyOffice API Documentation - Official OnlyOffice configuration reference