Open beta. Rin Chat is under active development. Expect rough edges, and please tell us what breaks.

Skip to content
Extension guide contents

Examples

Five small, complete extensions. Each folder holds extension/ (what ships: manifest.json and main.js) and a test file beside it, outside the package.

ExampleShowsPermissions
dice-rollA slash command, the app's dice engine, posting into the chat, a noticeui.command, chat.send, ui.notify
relationship-trackerA sidebar panel with buttons, an Adventure stat item, state in a chat variable, a line in the prompt each turnchat.vars, prompt.inject, ui.panel, ui.hud
summarizermodel.run from a command, its budget and errors, keeping the result in the chatchat.read, model.run, chat.vars, prompt.inject, ui.command, ui.notify
weatherrin.net.request to a declared host, the network levels and the review dialogui.command, chat.send, ui.notify; net: wttr.in
night-themeOffering a theme with ui.themeui.theme, ui.command

Run the tests

From an example's folder:

rinext test extension dice-roll.test.mjs
ok   offersTheCommand
ok   rollsAndPostsTheResult
ok   defaultsToOneD20
ok   explainsAnExpressionItCannotRoll

4 passed, 0 failed

Pack one

The manifests carry a placeholder author key (AAAA..., 43 characters), so they ship unsigned. To pack one, make your own key, put its public half in author.key, and change the id to one of your own:

rinext keygen ../keys
# paste the printed key into extension/manifest.json as author.key
rinext pack extension --key ../keys/rinext-author.key
rinext check com.example.dice-roll-1.0.0.rinext

pack refuses while the placeholder is there, since it is not the public half of your key. Developer mode can load an extension/ folder as it is, placeholder and all: a folder is not signed.

The weather example and the review dialog

The weather extension lists wttr.in in net, which only asks for it. After installing it, /weather Lisbon answers "No weather: its network access is Blocked", because every extension starts Blocked. On the extension's page in Settings > Extensions, set Network access to Ask every time (or Allowed hosts) and run the command again: the review dialog shows the exact request, GET https://wttr.in/Lisbon?format=3, the addresses it will connect to, and the headers Rin Chat adds. Allow once sends it; Always allow wttr.in in this chat sends it and stops asking in this chat. The tests cover each answer. See Network.