Skip to main content
Version: 1.0.5

IAppContext

@spartanfx/react v1.0.5


@spartanfx/react / IAppContext

Interface: IAppContext

Application-level context shared across the component tree using React Context API. Includes utilities, state, user/group info, and SPFI client.

Properties

PropertyTypeDescription
currentUser?ISiteUserInfoCurrent SharePoint user info.
currentUserGroups?ISiteGroupInfo[]SharePoint groups the current user is a member of.
customContextanyCustom context object that can be passed through the framework for extensibility.
debugModeOnbooleanDebug mode flag controlled via localStorage.
error(...args) => void[Synchronous] Logs an error. Always logs regardless of debug mode.
graph?GraphFIPnPjs SPFI instance.
isAdmin?booleanIndicates whether the current user has site admin permissions.
isMemberOf?(groupName) => boolean[Synchronous] Checks if the current user is a member of the specified group.
log(...args) => void[Synchronous] Logs a message if debug mode is enabled. Replaces console.log.
report(message) => Promise<void>[Asynchronous] Logs an error message to a centralized SharePoint list (stubbed).
setDebugMode(debugModeOn) => void[Synchronous] Enables or disables debug mode and persists the setting in local storage.
sp?SPFIPnPjs SPFI instance.
try(action, options?) => Promise<any>[Asynchronous] Executes an action inside a try/catch/finally block with automatic error handling and optional loading UI.
warn(...args) => void[Synchronous] Logs a warning if debug mode is enabled. Replaces console.warn.
webPartContext?WebPartContextCurrent Web Part context from SPFx.