Unlayer's Team Collaboration feature is available on Enterprise plans and works in on-premise deployments provided the host application implements the required providers. This article explains what needs to be configured and why.
Enabling Offline Mode
When deploying Unlayer on-premise, the offline flag must be set to true in the unlayer.init() configuration. This tells the editor to switch to its offline code path and stop calling Unlayer's cloud APIs entirely.
unlayer.init({ offline: true, // rest of your config });Enabling the Collaboration Feature
The collaboration flag is not added by default since every customer's init configuration varies. It needs to be explicitly set to true to activate Team Collaboration.
unlayer.init({
offline: true,
features: {
collaboration: true,
},
});Implementing the Required Providers
Once offline mode and collaboration are enabled, the editor does not call Unlayer's cloud APIs for any collaboration actions. Instead, it relies entirely on two providers that your application must implement and register:
collaborationThreads - handles listing, creating, updating, and deleting threads.
collaborationThreadComments - handles comments on threads.
js
unlayer.registerProvider('collaborationThreads', function(params, done) {
// Your implementation here
// Fetch, create, update or delete threads from your backend
done(threads);
});
unlayer.registerProvider('collaborationThreadComments', function(params, done) {
// Your implementation here
// Fetch or post comments from your backend
done(comments);
});What Happens Without the Providers
If offline: true is set but the providers are not registered, Team Collaboration will not work. The editor will surface errors like the following when a user attempts to load threads or comments:
Failed to load threads: Offline mode is enabled. Implement the "collaborationThreads" provider.
Note that the UI may still show the collaboration interface in some cases, but all actions will fail. The providers must be in place before the feature is usable.
β
Summary
For Team Collaboration to work in on-premise mode, three things need to be in place. The offline flag must be set to true in unlayer.init(), the collaboration feature flag must be set to true, and both the collaborationThreads and collaborationThreadComments providers must be implemented and registered. Without all three, the feature will either not appear or fail at runtime.
