Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/content/docs/docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ What changed on onlyworlds.com for everyone is on its own [Changelog](https://ww

## 2026-12-01

- **[Sign in with OnlyWorlds](/docs/development/api/signin#a-token-that-reads-worlds-only): a game signs in to read worlds.** Every game made with the engine packages signs in as one listed native client, `worlds-only-games`, with a loopback return (`GET /api/v2/auth/clients` lists 12 entries). The Continue page says "a game", since OnlyWorlds cannot tell which one is asking. Its token reads worlds only, as a self-registered client's does: `scope: "world:read"`, 720 hours, no `keys` on the list of worlds. The sign-in page gathers both kinds in one section ([on onlyworlds.com](https://www.onlyworlds.com/changelog#site-a-game-signs-in-to-read-worlds)).
- **[Toolkit](/docs/development/toolkit#skills) [v5.16.3](https://github.com/OnlyWorlds/toolkit/releases/tag/v5.16.3): the set-up writes folder format 0.3.26, and refuses a plan that would write a broken folder.** A plan that gives one key to two rows, or sets a key the writer sets itself (an id, a type, `x_seat`, the charter's marks), is refused with one sentence that says to leave it out. Before, the first wrote one id in two files and the second a file whose id disagreed with its name. When two elements of one type share a name and their ids end alike, the second is named by its full id, as [World folders](/docs/schema/folders#rules-for-tools) says.
- **[The account](/docs/development/api/signin#the-account): a new username holds no `@`.** A name set at sign-up or with `PATCH /api/v2/account` takes the letters a to z, the digits and `. + - _`; one with an `@` is the same `422` with `param` `username`. A name that already holds one is kept and keeps working. An account token of an account OnlyWorlds has switched off now answers `401` [`key_revoked`](/api/errors/#key_revoked), as a revoked one does.
- **[Sign in with OnlyWorlds](/docs/development/api/signin#ai-assistants): a client that registered itself reads worlds only.** Its account token, from `POST /api/v2/auth/token`, says `scope: "world:read"` and ends 720 hours after the exchange. `GET /api/v2/account/worlds` lists its worlds with no `keys` on any row. In a world it names, it reads the world, an element type's list, one element, search and metadata, and it may revoke itself; every other route answers `403` `permission_error`. A tool on the list of registered tools signs in as before.
Expand Down
10 changes: 7 additions & 3 deletions src/content/docs/docs/development/api/signin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The answer is sent `Cache-Control: public, max-age=60`, so a removed address sto
- **a loopback address**, `http://127.0.0.1/<path>` or `http://[::1]/<path>`, listed with no port. The app picks its port when it runs, and a `redirect_uri` on the same host and path matches with any port from 1 to 65535. `localhost` is never accepted: a name can resolve somewhere else.
- **a custom scheme**, matched exactly: a reverse-DNS scheme such as `com.example.app://callback`, or a known app's (`obsidian://`). `http`, `https`, `javascript`, `data` and `file` are never a custom scheme.

Two native apps are registered: the [Obsidian plugin](/docs/tools/obsidian-plugin) (`obsidian`, shown as OnlyWorlds Builder), with `http://127.0.0.1/onlyworlds-signin` and `obsidian://onlyworlds-signin`, and the OnlyWorlds desktop app (`onlyworlds-desktop`, shown as OnlyWorlds app, since 2026-11-30), with `http://127.0.0.1/signin/callback`. A native app is asked to press Continue at every sign-in. Since plugin 3.15.0 it signs in this way on desktop, through the loopback return; on a phone the button is hidden until the `obsidian://` return has been walked there.
Three native clients are registered: the [Obsidian plugin](/docs/tools/obsidian-plugin) (`obsidian`, shown as OnlyWorlds Builder), with `http://127.0.0.1/onlyworlds-signin` and `obsidian://onlyworlds-signin`, and the OnlyWorlds desktop app (`onlyworlds-desktop`, shown as OnlyWorlds app, since 2026-11-30), with `http://127.0.0.1/signin/callback`; and every game made with the engine packages (`worlds-only-games`, since 2026-12-01), with `http://127.0.0.1/signin/callback`. The Continue page names no game, only "a game", since OnlyWorlds cannot tell which game is asking, and the game's token [reads worlds only](#a-token-that-reads-worlds-only). A native app is asked to press Continue at every sign-in. Since plugin 3.15.0 it signs in this way on desktop, through the loopback return; on a phone the button is hidden until the `obsidian://` return has been walked there.

## Sending the person to sign in

Expand Down Expand Up @@ -91,7 +91,7 @@ curl -s -X POST "https://www.onlyworlds.com/api/v2/auth/token" \
{ "token": "ow_a_…", "token_id": "…", "token_type": "bearer", "expires_at": null, "account": { "id": "…", "username": "…" } }
```

The answer is sent `Cache-Control: no-store`. `expires_at` is when the token stops working, for a tool whose registration asks for a lifetime (1 to 720 hours; Little Lens's tokens last six), and 720 hours for [a client that registered itself](#ai-assistants); null for a listed tool with none, whose token works until it is revoked. An expired token is refused as a revoked one is, the same 401. `token` is shown only here: the tool keeps it and sends it as `Authorization: Bearer ow_a_…` on the [account routes](/docs/getting-started/keys#account-tokens), such as [managing members](/docs/development/api/members#managing-members), and to [read a world's elements](/docs/getting-started/keys#reading-a-world-with-an-account-token) as the person's own access there, with no key minted. On the person's account page, under Account tokens, it is listed by the tool's name and the browser (`Atlas on Firefox`), and they can revoke it there. `token_id` (since 2026-10-25) is the token's id: a tool done with the token revokes it with `DELETE /api/v2/account/tokens/{token_id}`, sending the token itself as the bearer. That revoke ends the tool's consent only when it was the tool's last live token for the person, or for a tool that asks each time ([Consent and revoking](#consent-and-revoking)). {/* limit: signin_token_lifetime_max_hours */}
The answer is sent `Cache-Control: no-store`. `expires_at` is when the token stops working, for a tool whose registration asks for a lifetime (1 to 720 hours; Little Lens's tokens last six), and 720 hours for [a client that registered itself or a game](#a-token-that-reads-worlds-only); null for a listed tool with none, whose token works until it is revoked. An expired token is refused as a revoked one is, the same 401. `token` is shown only here: the tool keeps it and sends it as `Authorization: Bearer ow_a_…` on the [account routes](/docs/getting-started/keys#account-tokens), such as [managing members](/docs/development/api/members#managing-members), and to [read a world's elements](/docs/getting-started/keys#reading-a-world-with-an-account-token) as the person's own access there, with no key minted. On the person's account page, under Account tokens, it is listed by the tool's name and the browser (`Atlas on Firefox`), and they can revoke it there. `token_id` (since 2026-10-25) is the token's id: a tool done with the token revokes it with `DELETE /api/v2/account/tokens/{token_id}`, sending the token itself as the bearer. That revoke ends the tool's consent only when it was the tool's last live token for the person, or for a tool that asks each time ([Consent and revoking](#consent-and-revoking)). {/* limit: signin_token_lifetime_max_hours */}

**A code lives 60 seconds and is spent by its first exchange,** whether that succeeds or fails. A code sent again is refused and also revokes the token its first exchange minted: a replayed code is treated as a stolen one. So take `code` out of the address bar before the exchange, and send the exchange before any other request: a reload would spend the code on a refusal. {/* limit: signin_code_seconds */}

Expand All @@ -118,6 +118,10 @@ An answer with no `scope` is a token that writes as the account does, so a tool

A read-only Continue covers only read-only sign-ins: the tool's first sign-in for the whole account shows the Continue page again, and that Continue then covers both.

### A token that reads worlds only

Two kinds of client get an account token that reads worlds and nothing else, whatever scope they ask for (since 2026-12-01): a client that registered itself (its `client_id` starts `dyn-`, see [AI assistants](#ai-assistants)) when it trades its code at the exchange above, and a game made with the engine packages, which signs in as `worlds-only-games` ([Registered tools](#registered-tools)). The answer says `scope: "world:read"`, and `expires_at` is 720 hours after the exchange; there is no refresh, so the game or tool offers the sign-in again after that. `GET /api/v2/account/worlds` lists the account's worlds with no `keys` on any row (the field is absent, never an empty list). In a world it names with `world`, the token reads the world, an element type's list, one element, search and metadata. It may revoke itself. Every other route that takes an account token answers it `403` [`permission_error`](/api/errors/#permission_error), and `ai_uses` on its exchange is a `422`. Every other tool on the list signs in as before, a read-only one included.

## The account

With the token, `GET /api/v2/account` reads the account itself: `id`, `username`, `email`, `date_joined`, and its **OnlyWorld**, the one world that stands for the account. `only_world` is `{ id, name, slug }`: the world the person chose, or, until they choose one, the oldest world the account owns (the first it created), or `null` while it owns none. `only_world_chosen` is true for a choice and false otherwise. When the chosen world is deleted, the oldest world left serves in its place. Only the account's own credential reads it: no world key, member or public reader does.
Expand Down Expand Up @@ -185,7 +189,7 @@ An AI assistant's connector, such as claude.ai's or ChatGPT's, signs a person in

The access token is an account token like any other: the [account page](https://www.onlyworlds.com/account/) lists it, and Revoke and Disconnect there end the chain.

**A registered client at the API's own exchange** (since 2026-12-01). A client that registered itself (its `client_id` starts `dyn-`) and trades its code at [`POST /api/v2/auth/token`](#trading-the-code) gets an account token that reads worlds only. The answer says `scope: "world:read"`, and `expires_at` is 720 hours after the exchange. `GET /api/v2/account/worlds` lists its worlds with no `keys` on any row (the field is absent, never an empty list). In a world it names with `world`, it reads the world, an element type's list, one element, search and metadata. It may revoke itself. Every other route that takes an account token answers it `403` [`permission_error`](/api/errors/#permission_error). A tool on [the list above](#registered-tools) signs in as before, a read-only one included.
**At the API's own exchange.** A client that registered itself and trades its code at [`POST /api/v2/auth/token`](#trading-the-code) gets [a token that reads worlds only](#a-token-that-reads-worlds-only) (since 2026-12-01).

## In the SDK

Expand Down
Loading