Skip to content

Commit 88e04cd

Browse files
SKILL.md: add Authentication section (xlogin) + xlogin to Related skills
1 parent f7530d3 commit 88e04cd

1 file changed

Lines changed: 23 additions & 3 deletions

File tree

SKILL.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,21 @@ A typical app composes the stack:
6060
<!-- 1. JSON-LD data island, inline (or load from a pod via ?uri= query param) -->
6161
<script type="application/ld+json">{ "@type": "Tracker", "issue": [...] }</script>
6262

63-
<!-- 2. Panes — declare which to load (LOSOS picks via canHandle) -->
63+
<!-- 2. Login (xlogin: Nostr NIP-07/NIP-98 + Solid OIDC/DPoP).
64+
One script tag adds the Login button and exposes window.xlogin.authFetch
65+
which LOSOS panes prefer over plain fetch for pod writes. -->
66+
<script src="https://unpkg.com/xlogin"></script>
67+
68+
<!-- 3. Panes — declare which to load (LOSOS picks via canHandle) -->
6469
<script type="module" data-pane src="https://losos.org/panes/todo-pane.js"></script>
6570
<script type="module" data-pane src="https://losos.org/panes/schema-pane.js"></script>
6671
<script type="module" data-pane src="https://solid-panes.github.io/schema-view.js"></script>
6772
<script type="module" data-pane src="https://losos.org/panes/source-pane.js"></script>
6873

69-
<!-- 3. Mount point -->
74+
<!-- 4. Mount point -->
7075
<div id="losos"></div>
7176

72-
<!-- 4. Boot: autoSchema patches $schema based on @type, then shell -->
77+
<!-- 5. Boot: autoSchema patches $schema based on @type, then shell -->
7378
<script type="module">
7479
import { autoSchema } from 'https://solid-panes.github.io/auto-schema.js'
7580
await autoSchema()
@@ -87,6 +92,20 @@ That's the universal pattern. What changes between apps is mostly: the data, whi
8792
4. Commit + push.
8893
5. The catalog (https://solid-apps.github.io/) and reverse-index update automatically.
8994

95+
## Authentication
96+
97+
xlogin (https://github.com/melvincarvalho/xlogin) is the auth layer of the stack — a single `<script src="https://unpkg.com/xlogin">` tag adds a Login button supporting both Nostr (NIP-07/NIP-98) and Solid (OIDC/DPoP). On login it exposes:
98+
99+
- `window.xlogin.type``"nostr"` or `"solid"`
100+
- `window.xlogin.id` — the user's pubkey or WebID
101+
- `window.xlogin.authFetch(url, opts)` — authenticated fetch (NIP-98 or DPoP based on login type)
102+
103+
LOSOS's panes already prefer `window.xlogin.authFetch` over plain `fetch` for writes — the pattern is `(window.xlogin && window.xlogin.authFetch) || fetch`. Adding the script tag is enough to enable real-pod writes; nothing else changes.
104+
105+
To target a real pod resource at runtime, the user appends `?uri=https://my.pod/today.jsonld` to the app URL. LOSOS's shell fetches it with `authFetch` and round-trips edits via authenticated PUT.
106+
107+
See https://github.com/melvincarvalho/xlogin/blob/gh-pages/SKILL.md for the full xlogin API.
108+
90109
## Don't
91110

92111
- Don't list types in `app.json#types` that aren't in urn-solid.
@@ -108,3 +127,4 @@ That's the universal pattern. What changes between apps is mostly: the data, whi
108127
- `solid-schema` — type contracts
109128
- `solid-panes` — pane registry (which pane handles which type)
110129
- `losos` — runtime
130+
- `xlogin` — auth (Nostr + Solid). https://github.com/melvincarvalho/xlogin/blob/gh-pages/SKILL.md

0 commit comments

Comments
 (0)