skills/extensions/umbraco-global-context/SKILL.md
Implement global contexts in Umbraco backoffice using official docs
npx skillsauth add albanist/umbraco_cli umbraco-global-contextInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Global contexts create a shared, type-safe layer of data and functions accessible throughout the backoffice. Unlike scoped contexts (like Workspace Contexts), global contexts persist for the entire backoffice session. Use them for sharing state between extensions, managing centralized services, or coordinating communication. Note: Prefer more specific context types when possible - Umbraco uses global contexts sparingly.
Always fetch the latest docs before implementing:
Context API: For understanding context consumption patterns
umbraco-context-apiState Management: For reactive state within contexts
umbraco-state-managementimport { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
import type { MyGlobalContext } from './my-global-context.js';
export const MY_GLOBAL_CONTEXT = new UmbContextToken<MyGlobalContext>(
'My.GlobalContext'
);
import { UmbContextBase } from '@umbraco-cms/backoffice/class-api';
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
import { MY_GLOBAL_CONTEXT } from './my-global-context.token.js';
export class MyGlobalContext extends UmbContextBase {
#currentValue = '';
constructor(host: UmbControllerHost) {
super(host, MY_GLOBAL_CONTEXT);
}
getValue(): string {
return this.#currentValue;
}
setValue(value: string): void {
this.#currentValue = value;
}
}
{
"name": "My Global Context Package",
"extensions": [
{
"type": "globalContext",
"alias": "My.GlobalContext",
"name": "My Global Context",
"js": "/App_Plugins/MyPackage/my-global-context.js"
}
]
}
import { UmbElementMixin } from '@umbraco-cms/backoffice/element-api';
import { MY_GLOBAL_CONTEXT } from './my-global-context.token.js';
class MyElement extends UmbElementMixin(LitElement) {
#myContext?: MyGlobalContext;
constructor() {
super();
this.consumeContext(MY_GLOBAL_CONTEXT, (instance) => {
this.#myContext = instance;
});
}
}
That's it! Always fetch fresh docs, keep examples minimal, generate complete working code.
tools
Umbraco Automate operations (event-driven workflow automation)
development
Webhook management (the Management API's outbound event notifications)
development
Backoffice user management (accounts, state, groups, API credentials)
tools
Backoffice user group management (permission sets)