You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: plugins/index.md
+13-9Lines changed: 13 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Plugin Development
2
2
3
-
Plugins — called **Custom Pages** in the panel UI — let you run your own web app
3
+
Plugins let you run your own web app
4
4
**inside 5Stack**. Same sidebar, same header, same theme, same login. Your app is
5
5
not part of 5Stack and does not require a fork or a rebuild of the panel.
6
6
@@ -11,8 +11,8 @@ remote. The panel loads it at runtime and mounts it on a native route,
11
11
-**No iframe.** Your component runs inside the panel's own Vue app, sharing its
12
12
Vue instance, its router, and its styling.
13
13
-**No second login.** The panel hands you the authenticated user. If you have a
14
-
backend, it sits behind 5Stack forward-auth instead of running its own Steam
15
-
OpenID flow.
14
+
backend, it exchanges the session cookie the browser already sends for a
15
+
verified identity, instead of running its own Steam OpenID flow.
16
16
-**Native look.** The shared `@5stack/ui` Tailwind preset and design tokens mean
17
17
your UI follows the operator's live branding automatically.
18
18
-**No panel rebuild.** Plugins live in a database registry. An admin adds a URL;
@@ -31,9 +31,9 @@ SwiftlyS2 or CounterStrikeSharp plugins on a game server, see
31
31
Federation remote. The build emits `dist/assets/remoteEntry.js`.
32
32
2. You ship a manifest, `5stack-plugin.json`, at the root of that same build.
33
33
3. You host `dist/` somewhere the panel's users can reach.
34
-
4. An admin pastes your URL into **Settings → Application → Custom Pages**, hits
34
+
4. An admin pastes your URL into **Settings → Application → Plugins**, hits
35
35
**Detect**, and enables it.
36
-
5. The panel writes a row into its `custom_pages` registry. Every connected
36
+
5. The panel writes a row into its plugin registry. Every connected
37
37
client picks the new entry up over a live subscription, renders a sidebar
38
38
item, and — when a user navigates to `/apps/<slug>` — fetches your
39
39
`remoteEntry.js`, resolves your exposed module, and mounts it:
@@ -61,7 +61,11 @@ you call [your own backend](/plugins/backend).
61
61
62
62
::: info No sandbox
63
63
A plugin is loaded into the panel's JavaScript context with no isolation. It can
64
-
read the host's cookies and reach into its stores. `requiredRole` controls who
64
+
reach into the host's stores and act as the logged-in user against any API the
65
+
panel can reach, and its backend receives that user's live session cookie. (The
66
+
cookie itself is `httpOnly`, so plugin JavaScript cannot read it directly — but
67
+
that is a small consolation given everything else it can do.) `requiredRole`
68
+
controls who
65
69
*sees* the page, not what the code *can do*. There is also no integrity pinning
66
70
on `remoteEntry.js` — the panel loads whatever the registered URL serves, so a
67
71
compromised plugin host compromises the panel for every user until the page is
@@ -73,8 +77,8 @@ yours.
73
77
74
78
| Repo | What it shows |
75
79
| --- | --- |
76
-
|[5stack-plugin-hello-world](https://github.com/5stackgg/5stack-plugin-hello-world)| The smallest complete plugin. Start here — copy it. |
77
-
|[5stack-inventory-plugin](https://github.com/lukepolo/5stack-inventory-plugin)| A production plugin with a Fastify backend, Postgres, forward-auth, and a Kubernetes deployment. |
80
+
|[5stack-example-plugin](https://github.com/5stackgg/5stack-example-plugin)| The smallest complete plugin. Start here — copy it. |
81
+
|[5stack-inventory-plugin](https://github.com/lukepolo/5stack-inventory-plugin)| A production plugin with a Fastify backend, Postgres, session-cookie auth, and a Kubernetes deployment. |
78
82
79
83
## Next steps
80
84
@@ -86,5 +90,5 @@ yours.
86
90
-[Styling](/plugins/styling) — Tailwind setup, design tokens, and the CSS
87
91
pitfalls unique to runtime-injected styles.
88
92
-[Components](/plugins/components) — what `@5stack/ui` actually gives you today.
89
-
-[Backend & Auth](/plugins/backend) — forward-auth and talking to your own API.
93
+
-[Backend & Auth](/plugins/backend) — verifying identity and talking to your own API.
90
94
-[Deploying](/plugins/deploying) — hosting, CORS, caching, and registration.
0 commit comments