Skip to main content

Runtime

What DocSpace hands a React plugin component: the current selection, the current user, and the clients the component reaches the portal with.

These are the return types of the hooks in Hooks — a plugin rarely needs to import them by hand, but they document what each hook gives back.

TCurrentFile​

Metadata of the file, folder or room currently selected in the DocSpace UI. Returned by useCurrentFile.

Properties​

PropertyTypeDescription
idstring | numberNumeric file/folder ID or string room ID.
titlestringDisplay name including extension, e.g. "Report Q4.docx".
fileExst?stringFile extension with the dot, e.g. ".docx" — the spelling the portal stores and FilesExst uses, so it compares directly against that enum. Present only for files.
isFolder?booleantrue when the selection is a folder (not a room).
isRoom?booleantrue when the selection is a room.
roomType?stringRoom type identifier, e.g. "CustomRoom". Present only for rooms.

TCurrentUser​

Profile of the user currently authenticated in the portal. Returned by useCurrentUser.

Properties​

PropertyTypeDescription
idstringInternal user GUID.
displayNamestringFull display name, e.g. "Jane Smith".
emailstringEmail address.
isOwnerbooleantrue for the portal owner account.
isAdminbooleantrue for DocSpace administrators.
isRoomAdminbooleantrue for room administrators.

PluginRuntime​

The full runtime context injected into every React plugin component by DocSpace. Access it directly via usePluginRuntime or use the focused hooks (useCurrentFile, usePluginActions, etc.) for better readability.

Properties​

PropertyTypeDescription
currentFileTCurrentFile | nullThe file, folder or room currently selected in the portal UI. null when nothing is selected.
currentUserTCurrentUser | nullThe authenticated portal user. null while the user profile is loading.
actionsPluginActionsPortal-side UI actions (toasts, modals, navigation, …).
apiPluginAPIClientTyped HTTP client scoped to the current portal.
settingsPluginSettingsClientClient for persisting and retrieving plugin settings.