How the UI runs
The UI is Search2o’s official interface: a single-page application bundled with the agent server. It uses the server’s REST API and nothing else, and you can build interfaces of your own on the same API.
Only the REST API
Every action in the UI is a call to the agent server’s REST API. The UI has no private endpoints and no other channel, so everything it does is available to your own code.
Where the UI lives
The UI’s files sit in the agent server’s ui directory, and the server serves them at its /ui path. Installing the agent server is sufficient.
Serving the UI from somewhere else
The files are static, so any web server or CDN can serve them. index.html carries one setting in a <meta name="search2o-ui-config"> tag:
| Setting | Meaning |
|---|---|
apiBase | Base URL of the agent server's REST API. Empty means the same origin as the UI. When the UI and the agent server are on different origins, add the UI's origin to the server's allowed CORS origins. |
Settings from the agent server
Everything else the UI needs, the REST timeout, how long a notification stays visible and the search behavior, is the uiConfig object of the agent server configuration. The UI fetches it with POST /api/auth/getUiConfig each time the page loads; the call needs no sign-in. A change takes effect when the agent server restarts and each user reloads the UI.
Your own interface
The UI is one client of the REST API, not a privileged one. A search box in your intranet, a chat bot, or a full application of your own can offer the same experience; see Creating your own client and Chat integrations.

