commit 5d5a69ffda2fb7b3548d22f477686ccd3aafcc2e Author: Tulir Asokan Date: Thu Sep 17 13:07:46 2020 +0300 Move stuff from readme diff --git a/Enabling-the-widget.md b/Enabling-the-widget.md new file mode 100644 index 0000000..8d868d6 --- /dev/null +++ b/Enabling-the-widget.md @@ -0,0 +1,35 @@ +1. Serve everything under `web/` using your webserver of choice. Make sure not + to serve the top-level data, as `config.json` and the Telethon session file + contain sensitive data. +2. Using `/devtools` in Element Web, edit the `m.widgets` account data event to + have the following content: + + ```json + { + "stickerpicker": { + "content": { + "type": "m.stickerpicker", + "url": "https://your.sticker.picker.url/?theme=$theme", + "name": "Stickerpicker", + "data": {} + }, + "sender": "@you:picker.url", + "state_key": "stickerpicker", + "type": "m.widget", + "id": "stickerpicker" + } + } + ``` + + If you do not yet have a `m.widgets` event, simply create it with that content. + You can also [use the client-server API directly][1] instead of using Element Web. + + The `theme=$theme` query parameter will make the widget conform to Element's + theme automatically. You can also use `light`, `dark` or `black` instead of + `$theme` to always use a specific theme. + + You can use https://maunium.net/stickers-demo/ as the URL to try out the + picker without hosting the files yourself. +3. Open the sticker picker and enjoy the fast sticker picking experience. + +[1]: https://matrix.org/docs/spec/client_server/latest#put-matrix-client-r0-user-userid-account-data-type