Embed administration in React
@open-enterprise/react exports a full console, independent panels, a default theme, and typed control and layout replacements.
The console composes the same exported panels.
The package uses React and Base UI; Vite builds the library and reference application.
Consumers need no Next.js router or Vite production server.
React and React DOM are peer dependencies and remain outside the library bundle.
Same-origin engine console
The application backend creates an entry from its verified parent session:
const entry = await enterprise.administration.portal.create({
organizationId,
sessionToken: serverSession.runtimeToken,
});
// Redirect the browser to entry.entry_url.The entry works once and expires after 60 seconds.
The engine exchanges it for a 30-minute child credential, bounded by its parent session.
The browser receives an HttpOnly, SameSite=Lax cookie; HTTPS uses a Secure __Host- cookie.
The entry code leaves the address bar through a 303 redirect.
The child session, parent, membership, current permissions, and bound operations are checked on every API call.
connectRuntime() reads /admin/session with same-origin credentials.
It retains a CSRF proof in memory and sends X-OE-CSRF on API calls.
That proof grants no bearer authority without the HttpOnly cookie.
The engine rejects cross-origin Origin values and cross-site Fetch Metadata.
It grants no cross-origin credentialed CORS access.
No third-party cookies or iframe integration is required.
Full console or individual panels
import {
AdministrationProvider, AdministrationConsole, PeoplePanel, RolesPanel,
connectRuntime,
} from "@open-enterprise/react";
import "@open-enterprise/react/styles.css";
const { client, session } = await connectRuntime();
<AdministrationProvider client={client} session={session}
branding={{ productName: "Acme Workspace", organizationName: "Acme" }}
appearance="dark" theme={{ "--oe-accent": "#a6b3ff", "--oe-radius": "16px" }}>
<AdministrationConsole />
</AdministrationProvider>;
// Use the same provider contract within vendor navigation:
<AdministrationProvider client={client} session={session}>
<PeoplePanel />
<RolesPanel />
</AdministrationProvider>;Each provider owns its session, organization, theme, controls, and data client.
A session contains organizationId, userId, sessionId, expiresAt, and permitted operations.
Changing its organization or session aborts requests and discards earlier results.
Mutations use a synchronous duplicate-submit lock and are never automatically retried by the panels.
Version conflicts require reloading current state before another save.
Destructive actions use a deliberate confirmation dialog.
The data client implements request(method, path, body?, signal?) and returns parsed JSON or undefined for HTTP 204.
A vendor backend bridge may implement that interface with its own server session.
Keep backend service credentials, parent bearer tokens, operator keys, introspection secrets, and signing keys on that backend.
The optional apps/admin-portal demonstrates encrypted child storage and same-origin proxying while rendering this same console.
A vendor bridge must enforce its own session and CSRF checks and forward the scoped child credential to the engine.
Engine authorization remains authoritative even when a vendor hides or replaces a control.
Theme and replacements
Semantic tokens include --oe-bg, --oe-surface, --oe-text, --oe-muted, --oe-accent,
--oe-accent-soft, --oe-border, --oe-danger, --oe-radius, --oe-font, and --oe-shadow.
Appearance supports light, dark, and the system preference.
Styles are scoped to the oe- component classes and do not reset the vendor page.
Dialog and select portals inherit their provider's appearance and token overrides.
Set local_authentication.branding.primary_color to style the runtime's sign-in pages.
For the reference console, set VITE_OE_CONSOLE_ACCENT to the same hex color when building @open-enterprise/console.
Fieldnote Projects uses #234f43.
controls accepts typed replacements for Button, Input, Textarea, Select, Dialog, and DataDisplay.
layouts replaces Shell, Header, and Navigation.
The console also accepts a controlled panel ID, panel-change callback, and custom panel composition.
Replacements must preserve values, change callbacks, disabled and busy states, labels, accessibility properties, and forwarded references.
Dialog replacements must retain focus trapping, focus return, Escape behavior, and accessible titles.
Select replacements must retain keyboard selection and the controlled value.
The shared panel owns mutation orchestration and current-authority checks.
See examples/react-embedding for a full console, selected panels, custom navigation and shell,
and button, input, select, and dialog replacements.
It installs built tarballs rather than private workspace sources:
npm run build
npm run test:react:consumerFor browser verification, serve its built dist directory through the runtime by setting ENTERPRISE_ADMIN_ASSETS_DIR.
Use /admin?mode=panels for vendor navigation, or /admin?appearance=dark for the dark theme.
The example always uses real engine APIs.
Operator console
connectOperator() and OperatorConsole use separate operator identity and authority.
They create no fictitious person or organization session.
An operator opens a one-use link from enterprise-runtime operator-entry config.yaml --operator operations.
The 15-minute cookie is bound to the current operator key and scope fingerprint.
The browser never receives the root operator key.
Resource introspection credentials created there require a root-authenticated one-use backend pickup.
Closing the operator console revokes that browser session.
Verified consumer workflows
The installed consumer supports ?mode=panels for vendor navigation and ?appearance=dark for the dark theme.
It composes people, roles, teams, resources, machines, security, SSO, directories, applications and audit panels.
The workspace refresh example reconnects through the backend-bound HttpOnly session.
Changing the provider session clears dialogs, selected people and one-time results as well as cancelling requests.
The browser suite holds a real response from the prior tenant and checks that it never appears after the switch.
The event panel supports bounded feed filters and paging, subscription creation and updates, secret rotation, revocation, retained-event replay and durable delivery attempts. The audit panel downloads a bounded, redacted JSON page with its end time and continuation cursor. For larger exports, use the SDK export iterator on a trusted backend. The operator console includes explicit identity-transition plans and separate review before applying their links.