The script editor is powered by Monaco Editor (the same editor used in VS Code), providing:
- JavaScript syntax highlighting
- Autocomplete and IntelliSense
- Multiple editor tabs for working with several scripts at once
Run your script by pressing Ctrl+Enter or clicking the Run button in the toolbar.
Scripts support top-level await — no need to wrap your code in an async function:
const item = await sc.Content.getItem("/sitecore/content/Home");
print(item.name);Every script has access to these built-in variables and functions:
The main API client, organized into 9 namespaces with 100+ methods:
| Namespace | Examples |
|---|---|
sc.Content |
getItem, createItem, updateItem, deleteItem, search |
sc.Publishing |
publishItem, publishSite, getPublishingStatus |
sc.Templates |
getTemplate, createTemplate, getTemplates |
sc.Sites |
getSite, getSites, createSite |
sc.Security |
getCurrentUser, getUsers, getRoles |
sc.Workflows |
getWorkflows, startWorkflow, executeWorkflowCommand |
sc.Indexes |
getIndexes, rebuildIndexes |
sc.Languages |
getLanguages, addLanguage |
sc.Translation |
translatePage, translateSite |
All methods on sc are also available directly (e.g., sc.getItem(...) works the same as sc.Content.getItem(...)).
| Function | Output Target |
|---|---|
print(...args) |
Console tab |
render(html) |
Results tab |
console.log/warn/error/info |
Console tab (with level badges) |
printItem(item) |
Console tab (formatted) |
renderItem(item) |
Results tab (rich HTML card) |
printUser, renderUser |
Formatted user display |
printRole, renderRole |
Formatted role display |
printTemplate, renderTemplate |
Formatted template display |
See Output Functions for detailed documentation.
In-script help system. See Using Help for details.
If a script throws an error, the error message and stack trace are displayed in the Console tab with an error badge. The script stops executing at the point of the error.
// This will show an error in Console:
const item = await sc.Content.getItem("/nonexistent/path");
print(item.name); // Error if item is null- Console — Shows text output from
print(),console.*calls, and errors. Each entry has a timestamp and level badge. - Results — Shows HTML output from
render()and the rich display helpers (renderItem,renderUser, etc.). Eachrender()call replaces the previous content.


