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
| Property | Type | Description |
|---|---|---|
id | string | number | Numeric file/folder ID or string room ID. |
title | string | Display name including extension, e.g. "Report Q4.docx". |
fileExst? | string | File 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? | boolean | true when the selection is a folder (not a room). |
isRoom? | boolean | true when the selection is a room. |
roomType? | string | Room type identifier, e.g. "CustomRoom". Present only for rooms. |
TCurrentUser
Profile of the user currently authenticated in the portal.
Returned by useCurrentUser.
Properties
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
| Property | Type | Description |
|---|---|---|
currentFile | TCurrentFile | null | The file, folder or room currently selected in the portal UI. null when nothing is selected. |
currentUser | TCurrentUser | null | The authenticated portal user. null while the user profile is loading. |
actions | PluginActions | Portal-side UI actions (toasts, modals, navigation, …). |
api | PluginAPIClient | Typed HTTP client scoped to the current portal. |
settings | PluginSettingsClient | Client for persisting and retrieving plugin settings. |