Learn how Scrivito CMS can help you deliver amazing digital experiences
See Scrivito CMS in action

currentEditor()

Returns the current editor.

const currentEditor = await Scrivito.load(() => Scrivito.currentEditor());

Scrivito.currentEditor returns the logged-in editor with their ID, name and the teams they belong to.

Returns

An Editor instance if the user interface is present, otherwise null.

Remarks

Returns null while loading.

Example

Render the number of teams the current editor is a member of:

const TeamCounter = Scrivito.connect(() => { const editor = Scrivito.currentEditor(); return <p>{editor.teams().length}</p>; });