@platform/console¶
Location: modules/platform/console/
Dependencies: @platform/core, @platform/schema, @platform/security, @platform/doc, @platform/socket, @platform/metaltura
Overview¶
@platform/console is the developer console module. It provides a built-in inspection and debugging UI that developers can access at runtime to introspect the live state of the platform.
Features:
- Browse all registered socket services and their methods.
- Inspect all active subscriptions with their status, parameters, and connected socket IDs.
- Monitor document state from @platform/doc.
Note: This module has only
clientandcommoncontexts — there is no server-side code.
Contexts¶
| Context | Entry point | Contents |
|---|---|---|
client |
src/client/index.ts |
ConsoleModule descriptor, DevLayout |
common |
src/common/index.ts |
i18n translations |
Client API¶
ConsoleModule¶
A ModuleProps object (compatible with Application in @platform/core/client) that registers the console as a navigable module in the application shell.
export const ConsoleModule: ModuleProps = {
name: 'Console',
title: 'console:module.title',
buttons: [
{
title: 'console:module.title',
icon: <CoreIcon icon='Computer' />,
path: '/console'
}
],
route: {
path: 'console',
Component: DevTool
}
}
Simply add ConsoleModule to the modules prop of Application to expose the console in the sidebar:
import { Application } from '@platform/core/client'
import { ConsoleModule } from '@platform/console/client'
export function App() {
return (
<Application
name="MyApp"
logo="/logo.png"
i18n={i18n}
modules={[ConsoleModule, /* other modules */]}
/>
)
}
DevLayout¶
Layout component used internally by the console to structure the developer tools UI.
Usage Example¶
// Register the console module in the app
import { ConsoleModule } from '@platform/console/client'
import { ChatModule } from '@platform/chat/client'
const modules = [ConsoleModule, ChatModule]
// Pass to Application
<Application modules={modules} ... />
When the app is running, the console is accessible at /console in the browser.