umbraco-context-api

Implement provider-consumer context sharing between Umbraco backoffice components.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The Umbraco Context API solves the problem of tightly coupling backoffice extensions by providing a clean, provider-consumer way to share data and services through a component hierarchy.

Core Features & Use Cases

  • Consume contexts with both subscription and one-time patterns to access notifications, user, modal manager, workspaces, and more.
  • Provide custom contexts using UmbContextToken so your extension can expose structured state to descendant components.
  • Prevent duplication and hard dependencies by cascading context values through the DOM tree in a type-safe manner.

Quick Start

Ask the agent whether you need to provide a new custom context token or consume an existing built-in context, then implement the corresponding provider-consumer pattern in your backoffice component.

Frequently Asked Questions about umbraco-context-api

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

FAQPage Schema
How do I share state between Umbraco backoffice components without tight coupling?▼

To share state across Umbraco backoffice components without tight coupling, use a provider-consumer mechanism with context tokens. This passes data safely through the DOM hierarchy using type-safe UmbContextToken instances.

What is the difference between consumeContext and getContext in Umbraco?▼

The difference between consumeContext and getContext in Umbraco involves subscription patterns. Use consumeContext for reactive subscription to context changes, or getContext for one-time static value retrieval from built-in or custom contexts.

How do I expose custom state to descendant components in Umbraco?▼

To expose custom state to descendant components in Umbraco, use provideContext with a type-safe UmbContextToken. This allows your extension to cascade structured state down the DOM tree to consumers.

Can I access built-in contexts like notifications and current user in Umbraco extensions?▼

Yes, you can access built-in contexts like notifications, current user, and workspace in Umbraco extensions. Consume these contexts using the provider-consumer pattern with appropriate UmbContextToken instances.

When should I use subscription versus one-time consumption for Umbraco context API?▼

Use subscription consumption for Umbraco context API when you need reactive updates to changing state, and one-time consumption with getContext when you only need a static snapshot of the current context value.