umbraco-global-context

Implement Umbraco Global Contexts with typed tokens and package manifest registration.

1|Updated May 21, 2026
One-click install
npx skills add https://github.com/1k-off/umbraco-observability-playground --skill umbraco-global-context-1k-off
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: umbraco-global-context
Source: https://github.com/1k-off/umbraco-observability-playground/tree/main/.agents/skills/umbraco-global-context
Command: npx skills add https://github.com/1k-off/umbraco-observability-playground --skill umbraco-global-context-1k-off

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you implement Umbraco Global Contexts so you can share consistent, session-scoped, type-safe state and actions across multiple backoffice extensions without relying on ad-hoc globals.

Core Features & Use Cases

  • Implements a Global Context token: Creates a strongly-typed context entry point that other UI/extension code can consume.
  • Provides a Global Context implementation: Implements the underlying context class that stores and returns shared state during the backoffice session.
  • Registers the extension in the package manifest: Ensures Umbraco loads the global context extension correctly so it’s available where needed.
  • Example consumption pattern: Demonstrates how to consume the context from backoffice components (e.g., mixins) to coordinate behavior across features.

Quick Start

Use the instruction: "Fetch the latest Umbraco docs for global contexts and then generate a complete global context token, implementation, and umbraco-package.json manifest for alias My.GlobalContext that exposes a get/set string value."

Frequently Asked Questions about umbraco-global-context

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I share state across Umbraco backoffice extensions?

To share state across Umbraco backoffice extensions, implement a globalContext using UmbContextToken for a typed API and extend UmbContextBase for the implementation class.

What is an Umbraco globalContext and when should I use it?

An Umbraco globalContext provides shared, session-scoped, type-safe state across the backoffice. Use it for extension development scenarios needing session-wide coordination rather than workspace-scoped data sharing.

How do I register a global context in the umbraco-package.json manifest?

To register a global context in the umbraco-package.json manifest, declare the extension as type globalContext. This ensures Umbraco loads the context correctly so its typed API is available for consumption.

Does Umbraco global context work with TypeScript for type-safe state?

Yes, Umbraco global context works with TypeScript by using UmbContextToken to define a strongly-typed API, enabling type-safe state and actions across extensions during the backoffice session.

Can I consume an Umbraco global context from backoffice components?

Yes, you can consume an Umbraco global context from backoffice components like mixins. The context provides a typed API entry point allowing UI code to coordinate behavior across multiple features.

Why does my Umbraco extension need a global context instead of ad-hoc globals?

You need a global context instead of ad-hoc globals to share consistent, type-safe state across extensions without relying on untyped variables. It uses UmbContextBase to manage session-scoped data safely.