Skip to content

Introduce Server-side editor API docs#18641

Merged
scofalik merged 23 commits intostablefrom
cc/server-side-editor-api
Jul 14, 2025
Merged

Introduce Server-side editor API docs#18641
scofalik merged 23 commits intostablefrom
cc/server-side-editor-api

Conversation

@DawidKossowski
Copy link
Copy Markdown
Contributor

Suggested merge commit message (convention)

Docs: Introduce Server-side editor API docs.


Additional information

Do NOT merge it before CS releases the feature.

godai78
godai78 previously approved these changes Jun 5, 2025
scofalik
scofalik previously approved these changes Jun 9, 2025
Copy link
Copy Markdown
Contributor

@scofalik scofalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some final improvements, I'll add them myself using GH UI.

@scofalik scofalik dismissed stale reviews from godai78 and themself via 7b1b366 June 9, 2025 13:43
scofalik
scofalik previously approved these changes Jun 9, 2025
godai78
godai78 previously approved these changes Jun 10, 2025
@Reinmar
Copy link
Copy Markdown
Member

Reinmar commented Jun 11, 2025

Just an idea – any chance for a simple system diagram that shows e.g. a scene like this (naming of things should probably be improved a bit):

graph TD
    %% User A and B
    subgraph Browser_A["Browser (user A)"]
        A1["Editor instance (user A)"]
    end

    subgraph Browser_B["Browser (user B)"]
        B1["Editor instance (user B)"]
    end

    %% Cloud Services
    subgraph Cloud["Cloud Services"]
        C1["Editor instance (virtual user)"]
        CS["Collaboration Server"]
    end

    %% Application Backend
    Backend["Application backend (your system)"]

    %% Connections
    A1 --> CS
    B1 --> CS
    C1 --> CS
    Backend -->|Server-side Editor API| C1
Loading


This guide explains how to write scripts that can be executed through the Server-side Editor API endpoint. The following sections provide examples of such scripts, each demonstrating a specific use case that can be automated on the server side.

For information about setting up and using the endpoint itself, see the {TODO: link Cloud Services Server-side Editor API} documentation.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, we should have a short example here, so all the necessary knowledge is in one place. At least from the API usage perspective – so assuming that someone uploaded a bundle and have credentials already. Something that will be sufficient for a person familiar with the Collab REST APIs already.

Alternatively/Optionally: This could be a screencast showing one of the usecases: E.g. adding a comment via SS Ed API, while it simultaneously shows up in the editor content in a browser.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: This screencast will be useful for the blog post as well (cc @wojtekidd)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, one completely unclear thing here is – how I choose which document will the SS Ed API apply? What do I need to do to set that up? What if there's a collab session already? What if not?

I suppose details of this will make sense in the CS guide, but some minor explanation here and practical example may help a lot.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be useful questions to answer @godai78

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll get to it, I believe :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, the tricky part will be how much to add to this guide to understand enough without the need to jump around.

* **AI-powered editing**: Make automated suggestions while users are actively editing, helping improve content quality.
* **Automated publishing**: Prepare and process content for publication, including formatting, metadata updates, and resolving comments.

## Getting started with server-side editor API
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great guide, I really like it. I have one problem, imagining the total noob users, like me, I couldn't answer the question from where should I get the editor instance in all of those cases.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually know that bit from the demo that we had on All Hands :D But yeah – that's exactly the reason why we need a practical example.

Second part that's unknown: how to read (and that you can actually pass) params from the REST endpoint.

Copy link
Copy Markdown
Contributor

@scofalik scofalik Jun 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, editor is a globally available variable, I think it could be mentioned just before the very first snippet. And we should also mention that you can simply copy-paste these snippets as payload for the REST API endpoint.

But one more missing piece of data may be that you actually need to upload the bundle. Of course that will be in the CS guide, but would be good to have it here as well?

Thanks for comments, we are biased with having this knowledge.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do realize this is not exactly a guide for total noobs? We need to assume the user reading this has already gone through some of our docs, and also, I think we should link some to not duplicate all the knowledge. The question is the extent of this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think even mediocre and advanced noobs will have no idea where the magic variable in 5+ snippets comes from and how to get it on the server ;)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this one is true :D

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not fully agree with those comments. The idea and the requirements were to prepare scripts that would inspire people and function correctly when copied&pasted -- and this has been fulfilled. No one will be able to use the SS Editor API without referring to the CS documentation, where detailed information should be provided.

However, if you feel that this information should be included here as well, we will add it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only need a sentence or a callout (note) that editor is globally available, that's all :D.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was added this morning :)


### Getting editor data

The most basic action you can perform is getting the editor's data. We use {@link module:core/editor/editor~Editor `editor`} for that, as it is a {@link getting-started/setup/editor-lifecycle globally available variable}.
Copy link
Copy Markdown
Member

@Witoso Witoso Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a fully correct sentence. editor is not globally available unless someone makes it. We enable in Cloud as such. We need an explicit mention that in Cloud env editor is available globally.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is relevant to all snippets (not just data). I propose to move this https://github.com/ckeditor/ckeditor5/pull/18641/files#r2152270879

scofalik
scofalik previously approved these changes Jun 30, 2025
scofalik
scofalik previously approved these changes Jun 30, 2025
godai78
godai78 previously approved these changes Jul 1, 2025
@godai78
Copy link
Copy Markdown
Contributor

godai78 commented Jul 2, 2025

Looks like the CS part has been merged: https://github.com/cksource/docs/pull/760

@godai78

This comment was marked as outdated.

@jflakus-cksource
Copy link
Copy Markdown

jflakus-cksource commented Jul 7, 2025

Docs are available on prod: https://ckeditor.com/docs/cs/latest/guides/collaboration/server-side-editor-api.html

@Witoso
Copy link
Copy Markdown
Member

Witoso commented Jul 7, 2025

Are we rebasing to release?

@godai78
Copy link
Copy Markdown
Contributor

godai78 commented Jul 8, 2025

Are we rebasing to release?

No real need to do that. We may merge it now, "as is," just as well. Unless we specifically want to ship it with the release for some reason.

@Witoso
Copy link
Copy Markdown
Member

Witoso commented Jul 9, 2025

Please plan the merge of it 😊

godai78
godai78 previously approved these changes Jul 9, 2025
@scofalik scofalik merged commit 6b4bcb3 into stable Jul 14, 2025
11 checks passed
@scofalik scofalik deleted the cc/server-side-editor-api branch July 14, 2025 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants