agent-maurice-viewer is the frontend starter and integration monorepo for
applications that consume AgentMaurice viewer and mini-app surfaces.
Use it when you want to:
- ship a customer-facing or operator-facing frontend on top of AgentMaurice
- bootstrap a viewer by
slugordeploymentId - render AgentMaurice mini-apps in React
- embed the viewer in an existing website
- start from a runnable demo instead of building a client runtime from scratch
This repository is organized as npm workspaces under packages:
viewer-core: shared runtime layer- viewer bootstrap
- API client
- state handling
- auth adapter interfaces
- payload normalization and runtime contracts
viewer-web: React renderer and web UI components for AgentMaurice viewer experiencesviewer-embed: embeddable Web Component for integration in an existing siteviewer-demo: runnable demonstration app and the best starting point for a publishable client applicationviewer-app: minimal local app shell for viewer-web based development
Choose the package that matches your integration strategy:
- Start with
viewer-demoif you want a full app starter with routing, local preview flows, and a Supabase auth example. - Start with
viewer-webif you already have a React app and only need the viewer runtime and UI layer. - Start with
viewer-embedif you need a Web Component that can be dropped into an existing website. - Use
viewer-coreonly if you need a custom client integration below the React or Web Component layers.
This repo is designed for client applications that need to connect to an AgentMaurice deployment and expose one or more of these surfaces:
- viewer bootstrap for a mini-app or interactive deployment
- OpenUI-backed rendering through the viewer runtime
- frontend auth flows such as Supabase, Firebase, OIDC, or an external token provider
- branded client delivery built on top of AgentMaurice backend capabilities
In practice, a common setup is:
- build or deploy the backend application in AgentMaurice
- choose the target deployment that the frontend should consume
- start from
viewer-demo,viewer-web, orviewer-embed - wire the frontend auth strategy and viewer entry mode
- brand and publish the client app
Install dependencies from the repo root:
npm installRun the demo application:
npm run dev --workspace @agent-maurice/viewer-demoBuild the main packages:
npm run build --workspace @agent-maurice/viewer-core
npm run build --workspace @agent-maurice/viewer-web
npm run build --workspace @agent-maurice/viewer-embedRun the minimal app shell:
npm run dev --workspace @agent-maurice/viewer-appviewer-demo is the most useful entry point if you
want to understand the project quickly or fork it into a customer-facing app.
It currently includes:
- viewer bootstrap by
slugordeploymentId - a Supabase frontend auth example
- local mock preview scenarios
- OpenUI-oriented demo flows
- offline preview routes that do not require a live viewer backend
See packages/viewer-demo/README.md for the
environment variables and routes.
The viewer stack is well suited to bearer-token-based flows on viewer surfaces. That said, compatibility still depends on the exact AgentMaurice backend surface you are targeting.
In particular:
- viewer bootstrap aligns well with bearer-token flows
- some recipe backend checks can also align well
- some mini-app runtime endpoints may still require deployment API keys, depending on the current backend surface
So this repository should be treated as the recommended client starter for viewer-centric integrations, with final auth validation done against the target AgentMaurice deployment.
Mini-app forms are submitted through the app event endpoint, not through a generic form endpoint.
The contract is:
POST /app/instances/{appInstanceId}/events/{eventId}eventIdmust come from the UI contract- for a
form_link, usesubmit_eventwhen it is present - only fall back to
form_submitwhen no explicitsubmit_eventis provided - send user-entered values in
form_data - keep UI context such as
form_idinpayload
Example:
{
"payload": {
"form_id": "main_form"
},
"form_data": {
"cahier_des_charges": "...",
"document_reponse": "..."
},
"expected_state_version": 1
}This matters because many recipes declare named events such as
submit_main_form. Hardcoding form_submit in the renderer can make the
backend reject the request with 404 app event not found.
This repository is intended to serve as a base for a public or private client application built on top of AgentMaurice.
Use it as:
- a runnable demo
- a frontend starter repository
- a React integration layer
- an embed layer for existing websites