guideDocument storage

# Overview

This feature allows you to permanently save the document data in CKEditor Cloud Services. When enabled, documents are no longer stored temporarily just for the duration of the document session lifetime. Instead, they are saved permanently in the CKEditor Cloud Services server.

When a user connects to a previously existing document for which a collaboration session has already expired, the document is automatically loaded into the collaboration session.

# Benefits of the document storage feature

  • Reduced number of requests to your server. Collaborating users no longer need to send the document data in time intervals.
  • Your server is completely excluded from the responsibility of saving the document.
  • The process of saving the document data is independent of the users’ or your server’s network conditions.
  • No need to check whether a collaborative document session currently exists.
  • No need to load the current content of the document in case the collaboration session has expired.
  • No race condition problem when saving the document data.
  • Documents are saved in an encrypted form.
  • It is possible to get or delete documents from the storage or get the documents list.

# Requirements

Follow the steps below to set up the document storage feature.

  1. Set the required bundleVersion property in the editor configuration. Refer to the Editor configuration section of the Editor bundle documentation for more details.

  2. Upload your editor bundle with the editor configuration to the CKEditor Cloud Services server. Refer to the Editor bundle guide for more information.

  3. Log in to the CKEditor Ecosystem dashboard and navigate to “Your products > Cloud Services”.

  4. From the list of available subscriptions in the dashboard choose the subscription that you want to manage and press the “Manage” link.

Your products view in CKEditor Ecosystem customer dashboard.

  1. Select the environment where you want to enable the document storage feature.

Select environment that you want to manage.

  1. Navigate to the “Feature configuration” tab.

Feature configuration view.

  1. Switch on the feature in the “Storage > Document storage” section.

Feature configuration with enabled document storage.

Remember that the document storage feature works only for the environment where it was turned on. If you use many environments, you must enable it separately for each of them.

# Usage

# Saving the document

After fulfilling the requirements above, the documents will be saved automatically. When using this feature, your users collaborate in the document as they did before, but there is no need to use your server as a database for document data.

# Document management

Managing stored documents involves using methods available from the REST API level in the Documents section.

Available methods:

  • GET /documents/{document_id} – Gets the data of a single document that is saved in the storage.
  • GET /documents – Gets the list of document IDs that are saved in the storage.
  • DELETE /documents/{document_id} – Deletes a single document from the storage.

# Document storage webhooks

You can receive information about the processing of your document in the document storage in the form of webhook events. Refer to the Document storage events section for more details.

# Example

Check an example of an application that uses the document storage feature in Node.js and Express.js.

Also, you can check CKEditor Cloud Services samples repository, where you can find more examples.

# Debugging

If needed, it is possible to store all collaboration data for debugging purposes. Thanks to this, our customer support team will be able to check the errors related to the document storage feature.

When this option is enabled, the data will be stored only for debugging purposes. Please enable this option only when you are asked to do do by our customer support team.