コンテンツにスキップ

Facade

The wippy/facade module provides a portable iframe facade that loads and configures the Wippy frontend from a CDN. It serves an HTML shell that creates an iframe pointing to the frontend bundle, handles authentication, and bridges configuration between the backend and frontend.

Add the module to your project:

Terminal window
wippy add wippy/facade
wippy install

Declare the dependency:

version: "1.0"
namespace: app
entries:
- name: gateway
kind: http.service
addr: :8090
lifecycle:
auto_start: true
- name: api
kind: http.router
meta:
server: app:gateway
prefix: /api/public
- name: dep.facade
kind: ns.dependency
component: wippy/facade
version: "*"
parameters:
- name: server
value: app:gateway
- name: router
value: app:api
ParameterRequiredDefaultDescription
serveryesHTTP server for static and iframe serving
routeryesPublic API router for config endpoint
fe_facade_urlnohttps://web-host.wippy.ai/webcomponents-1.0.21Base URL for iframe frontend bundle
fe_entry_pathno/iframe.htmlIframe HTML entry point path
ParameterDefaultDescription
app_titleWippyTitle shown in sidebar
app_nameWippy AIFull application name
app_iconwippy:logoIconify icon reference
ParameterDefaultDescription
hide_nav_barfalseHide the left navigation sidebar
disable_right_panelfalseDisable the right sidebar panel
start_nav_openfalseNavigation drawer open by default
show_admintrueShow admin panel toggle
allow_select_modelfalseAllow user to select LLM model
session_typenon-persistentChat session persistence: non-persistent or persistent
history_modehashBrowser history mode: hash or history
hide_session_selectorfalseセッション選択 UI を非表示にする

3 つのスコープが適用されます: global(あらゆる場所)、host(iframe を囲むクローム)、children(iframe 内のコンテンツ)。

ParameterスコープDefault説明
custom_cssglobalGoogle Fonts importあらゆるレベルに注入される CSS
css_variablesglobal{}CSS カスタムプロパティの JSON マップ
icon_setsglobal[]Iconify アイコンセット URL
host_custom_csshost""host クローム専用の CSS
host_css_variableshost{}host 専用の CSS カスタムプロパティ
host_icon_setshost[]host 専用のアイコンセット
children_custom_csschildren""iframe コンテンツ専用の CSS
children_css_variableschildren{}iframe コンテンツ専用の CSS カスタムプロパティ
login_path/login.html未認証ユーザーのリダイレクト先パス

以下の各パラメータは JSON エンコードされた文字列です。デフォルトは空({} または [])です。これらはそのまま hostConfig 配下でフロントエンドに公開されます。

ParameterDefault説明
api_routes{}フロントエンドのルートオーバーライド
additional_nav_items[]追加のサイドバー項目
state_cache{}フロントエンドの状態キャッシュ設定
allow_additional_tags[]チャットで許可される追加の HTML タグ
chat{}チャット UI のオーバーライド
axios_defaults{}フロントエンド axios HTTP クライアントのデフォルト

The facade registers GET /facade/config on the configured router. The frontend fetches this on load:

{
"facade_url": "https://web-host.wippy.ai/webcomponents-...",
"iframe_origin": "https://web-host.wippy.ai",
"iframe_url": "https://web-host.wippy.ai/webcomponents-.../iframe.html?waitForCustomConfig",
"login_path": "/login.html",
"env": {
"APP_API_URL": "https://api.example.com",
"APP_AUTH_API_URL": "https://api.example.com",
"APP_WEBSOCKET_URL": "wss://api.example.com"
},
"routePrefix": "https://api.example.com",
"axiosDefaults": { "...": "..." },
"theming": {
"global": { "customCSS": "...", "cssVariables": {}, "iconSets": {} },
"host": { "customCSS": "...", "cssVariables": {}, "iconSets": {}, "i18n": { "app": { "title": "Wippy", "icon": "wippy:logo", "appName": "Wippy AI" } } },
"children": { "customCSS": "...", "cssVariables": {} }
},
"hostConfig": {
"session": { "type": "non-persistent" },
"history": "hash",
"showAdmin": true,
"allowSelectModel": false,
"startNavOpen": false,
"hideNavBar": false,
"disableRightPanel": false,
"hideSessionSelector": false,
"apiRoutes": { "...": "..." },
"additionalNavItems": [],
"stateCache": { "...": "..." },
"allowAdditionalTags": [],
"chat": { "...": "..." }
}
}

API URLはPUBLIC_API_URL環境変数から読み取られます。APP_WEBSOCKET_URLhttp://ws://に、またはhttps://wss://に置き換えて導出されます。テーミングには3つのスコープ(globalhostchildren)があります — host.i18nにはアプリのブランディングが含まれます。hostConfigキーはcamelCaseで、facadeパラメータから組み立てられます: session_typehistory_modeshow_adminallow_select_modelstart_nav_openhide_nav_bardisable_right_panelhide_session_selector、加えてオプションのapi_routesadditional_nav_itemsstate_cacheallow_additional_tagschataxios_defaults

Pages registered via wippy/views appear in the sidebar automatically based on their metadata:

entries:
- name: dashboard
kind: registry.entry
meta:
type: view.page
name: dashboard
title: Dashboard
icon: tabler:chart-bar
group: Analytics
group_icon: tabler:chart-dots
group_order: 10
order: 1
announced: true
secure: true
url: https://cdn.example.com/dashboard/

Pages with the same group value are collected into collapsible sections. Groups are sorted by group_order (lower first), pages within groups by order.

FieldDescription
groupCategory name displayed in sidebar
group_iconIcon for the category header
group_orderSort position of the group (lower = higher)
group_placement"sidebar" (in sidebar) or "default" (main area only)

Pages without a group appear as top-level items.

FieldEffect
announced: truePage appears in sidebar navigation
announced: falsePage hidden from navigation but still accessible via URL
inline: trueInternal page, hidden from all UI listings
hide_nav_bar: trueFacade parameter — hides the entire left sidebar

When publishing a component that includes static files (like the facade’s public/ directory), use --embed to include fs.directory entries in the package:

Terminal window
wippy publish --embed facade:public_files

Without --embed, fs.directory entries are excluded from the published package. The --embed flag accepts entry IDs or names matching fs.directory entries.