CloudServicesConfig

Api-interface icon interface

The configuration for all plugins using CKEditor Cloud Services.

ClassicEditor
	.create( document.querySelector( '#editor' ), {
		cloudServices: {
			tokenUrl: 'https://example.com/cs-token-endpoint',
			uploadUrl: 'https://your-organization-id.cke-cs.com/easyimage/upload/'
		}
	} )
	.then( ... )
	.catch( ... );
Copy code

See all editor options.

Properties

  • Chevron-right icon

    autoRefresh : boolean | undefined

    Specifies whether the token should be automatically refreshed when it expires.

    When set to false, the token will not be automatically refreshed, and you will need to handle token refresh manually.

    ClassicEditor
    	.create( document.querySelector( '#editor' ), {
    		cloudServices: {
    			tokenUrl: 'https://example.com/cs-token-endpoint',
    			// Disable automatic token refresh.
    			autoRefresh: false,
    			...
    		}
    	} )
    	.then( ... )
    	.catch( ... );
    
    Copy code

    Defaults to true

  • Chevron-right icon

    bundleVersion : string | undefined

    An optional parameter used for integration with CKEditor Cloud Services when uploading the editor build to cloud services.

    Whenever the editor build or the configuration changes, this parameter should be set to a new, unique value to differentiate the new bundle (build + configuration) from the old ones.

  • Chevron-right icon

    connectionTimeout : number | undefined

    The timeout (in seconds) for the connection. Defaults to 10.

    If the connection will not be established after the specified number of second passes, the editor will throw an error.

    Raise this value if you are experiencing connection timeout problems.

    ClassicEditor
    	.create( {
    		cloudServices: {
    			connectionTimeout: 20,
    			// ...
    		}
    	} )
    	.then( ... )
    	.catch( ... );
    
    Copy code
  • Chevron-right icon

    requestTimeout : number | undefined

    The timeout (in seconds) for each request send to the Cloud Services. Defaults to 20.

    If the request is not finished after the specified number of second passes, the editor will throw an error.

    Raise this value if you expect that your requests will be big (e.g. mostly concerns the document data and the initial request).

    ClassicEditor
    	.create( {
    		cloudServices: {
    			requestTimeout: 40,
    			// ...
    		}
    	} )
    	.then( ... )
    	.catch( ... );
    
    Copy code
  • Chevron-right icon

    tokenUrl : TokenUrl | undefined

    A token URL or a token request function.

    As a string, it should be a URL to the security token endpoint in your application. The role of this endpoint is to securely authorize the end users of your application to use CKEditor Cloud Services only if they should have access e.g. to upload files with CKBox or to use the Collaboration service.

    ClassicEditor
    	.create( document.querySelector( '#editor' ), {
    		cloudServices: {
    			tokenUrl: 'https://example.com/cs-token-endpoint',
    			...
    		}
    	} )
    	.then( ... )
    	.catch( ... );
    
    Copy code

    As a function, it should provide a promise to the token value, so you can highly customize the token and provide your token URL endpoint. By using this approach you can set your own headers for the request.

    ClassicEditor
    	.create( document.querySelector( '#editor' ), {
    		cloudServices: {
    			tokenUrl: 'https://example.com/cs-token-endpoint',
    			...
    		}
    	} )
    	.then( ... )
    	.catch( ... );
    
    Copy code

    If the request to the token endpoint fails, the editor will call the token request function every 5 seconds in attempt to refresh the token.

    You can find more information about token endpoints in the Easy Image guide and Cloud Services - Token endpoint documentation.

    Without a properly working token endpoint (token URL) CKEditor plugins will not be able to connect to CKEditor Cloud Services.

  • Chevron-right icon

    uploadUrl : string | undefined

    The endpoint URL for CKEditor Cloud Services uploads. This option must be set for Easy Image to work correctly.

    The upload URL is unique for each customer and can be found in the CKEditor Ecosystem customer dashboard after subscribing to the Easy Image service. To learn more, check the Easy Image guide.

    Note: Easy Image is a legacy product and only maintained for existing clients.

    Note: Make sure to also set the tokenUrl configuration option.

  • Chevron-right icon

    webSocketUrl : string | undefined

    The URL for web socket communication, used by the RealTimeCollaborativeEditing plugin. Every customer (organization in the CKEditor Ecosystem dashboard) has their own, unique URLs to communicate with CKEditor Cloud Services. The URL can be found in the CKEditor Ecosystem customer dashboard.

    Note: Unlike most plugins, RealTimeCollaborativeEditing is not included in any CKEditor 5 build and needs to be installed manually. Check Collaboration overview for more details.