Cloud
To install ONLYOFFICE Docs in the cloud:
Deploy ONLYOFFICE Docs Developer solution in the cloud using our instructions from ONLYOFFICE Help Center.
In the target HTML file where the editors are to be embedded, specify a placeholder div tag, where all the information about the editor parameters will be passed:
<div id="placeholder"></div> <script type="text/javascript" src="https://documentserver/web-apps/apps/api/documents/api.js"></script>
Where documentserver is the public IP address or public DNS provided by your cloud. It is automatically allocated by the system and can be found in the Instances section of the cloud console.
https://documentserver/web-apps/apps/api/documents/api.js
is the address where the API JavaScript file can normally be found.Starting from version 8.1, it is recommended to add the shardkey parameter to the URL QueryString with the key value in it. For example, ?shardkey=Khirz6zTPdfd7. This allows you to load balance requests.
Specify the page code containing the changeable parameters:
const docEditor = new DocsAPI.DocEditor("placeholder", config)
Where config is an object:
const config = { document: { fileType: "docx", key: "Khirz6zTPdfd7", title: "Example Document Title.docx", url: "https://example.com/url-to-example-document.docx", }, documentType: "word", editorConfig: { callbackUrl: "https://example.com/url-to-callback.ashx", }, }
Where example.com is the public IP address or public DNS provided by your cloud where document manager and document storage service are installed. See the How it works section to find out more on ONLYOFFICE Docs service client-server interactions.
From now the docEditor object can be used to call the document editor Methods.
The example above includes all the parameters necessary for ONLYOFFICE Docs correct startup.
Specify the additional non-obligatory parameters that can be changed to achieve different goals with your document (change access rights for the document, display different information about the document, etc.). See the Advanced parameters section to find out what these parameters are and how you can change them.
Add an encrypted signature to the requests in the form of token to prevent the substitution of important parameters.