clone

nostr relays on demand at <name>.bind.ws: claim one with your key, pay in zaps past the free allowance

main
bindws / connection-templates / README.md
README.md 3.7K rendered
1# Connection templates23An app shortcut on a relay's Connect fold is one of these files, chosen by4the owner. Each says which app opens, what it does with this relay, and the5links that hand a viewer over to it, written once with placeholders the6relay fills in for whoever is looking. One good template works for anyone.78| Template | Choose it when |9|---|---|10| [notes](01-notes.jsonc) | the relay is a feed and Jumble should open it as one. |11| [find-me](02-find-me.jsonc) | feed apps should meet this relay through the owner's profile with the relay attached. |12| [group](03-group.jsonc) | the relay's group is a room, in Flotilla or any group-aware app. |13| [blog](04-blog.jsonc) | the owner writes articles and YakiHonne should open them with this relay attached. |14| [repos](05-repos.jsonc) | the relay hosts Git repositories; GitWorkshop opens them and the clone command names yours. |15| [sites](06-sites.jsonc) | the relay hosts NIP-5A sites: the owner's, the viewer's own, and the nsyte command that publishes one. |16| [bookmarks](07-bookmarks.jsonc) | signed-in viewers keep bookmarks and lists here and Listr should manage them. |17| [photos](08-photos.jsonc) | the owner's photos live on this relay's file store and only the owner should see the shortcut; the read rule, not the shortcut, says who may see the files. |18| [files](09-files.jsonc) | members keep files on this relay's Blossom store and bouquet should manage them. |19| [dm](10-dm.jsonc) | the relay is a DM inbox and people should message the owner privately from here. |20| [marmot](11-marmot.jsonc) | the relay carries Marmot groups and White Noise is the app. |21| [relay-page](12-relay-page.jsonc) | Coracle should open the relay's page: its feed and its people. |2223## The files2425A template is a JSON document (`$schema` names the copy served at26`https://bind.ws/connection-template.schema.json`, the same file as27`../connection-template.schema.json`) with a title, one sentence about it,28the app, where the app runs, an icon, the links, and optionally the feature29the shortcut needs, the visibility it starts with, what its QR carries and30the inputs the owner fills in when adding it. An input whose value lands in31a URL path or a shell command names a `pattern` the value must match, so32what the owner types cannot change the link or the command around it. The33fold has one relay URL copy control of its own, so a template does not34carry one.3536Links and the QR text carry placeholders:3738| Placeholder | Fills in |39|---|---|40| `{relay:url}` `{relay:host}` `{relay:web}` `{relay:name}` `{relay:domain}` | `wss://name.bind.ws`, `name.bind.ws`, `https://name.bind.ws`, `name`, `bind.ws` (where NIP-5A sites live) |41| `{relay:hex}` `{relay:npub}` `{relay:nprofile}` `{relay:naddr}` | the relay's own key, and the group address |42| `{owner:hex}` `{owner:npub}` `{owner:nprofile}` | the owner, the nprofile with this relay as the hint |43| `{user:hex}` `{user:npub}` `{user:nprofile}` | whoever is signed in and looking; a link that needs one is not shown to a visitor |44| `{input:<name>}` | what the owner typed into the template's input of that name |4546A `|enc` suffix, as in `{relay:url|enc}`, percent-encodes the value for a47query string. The number in the file name is the order the library shows48them in.4950`npm run build:connections` folds the folder into `src/gen/connections.ts`,51which the relay serves as its library; `npm run typecheck` checks every file52here against the schema and the placeholder vocabulary, fails when the53generated module is stale, and fails when a file is missing from the table54above. A relay template in `../relay-templates/` names these in its55`connections` section, so one preset sets the rules and the shortcuts56together ([Connection templates](../docs/17-connection-templates.md)).