Using Discohook as an external message designer or previewer
Discohook can be used as a way to draft messages to be later exported to an external application--sort of. This page will go over the various ways third-party apps can take advantage of Discohook, but its explicit support for these use cases is currently more barebones than we would like it to be in the future.
Editing/Exporting
When a user is designing a message, the page address's query parameters will change based on various conditions:
- If the user is editing a backup, only
backup
will be present (the backup ID). Due to the risk of exposing sensitive data, backups are currently not public. This will change in the future. - Otherwise, if the full URL including data is fewer than 16kb, it will contain the
data
as a URL-encoded base64 string. When decoded, it will be compliant with the QueryData schema.
You may glean that there are two scenarios in which a plain discohook.app URL may not be used by an application to read the data that the user can see. You will likely find it preferable to only deal with share links.
Share Links
When a user provides your application with a share link, it should be a https://discohook.app
URL, path /
, with one query parameter: share
.
:::warning
We no longer support legacy share.discohook.app
addresses. They will still redirect, but IDs parsed from the /go/:id
path are not resolvable with the Get Share Link route.
:::
In the future
We want to implement one or multiple of the following:
- Publicizable backups (almost definitely happening & not exclusive to developers)
- An "Export Data" button that is more clearly for interacting with third party apps
Previewing
We expose a /viewer
route for applications that would like to display arbitrary message data. It is iframe-friendly (?) and supports a header=false
query argument to hide the top navbar. The data this route displays is provided via the data
parameter and must follow the same schema as on the index route.
In the future
We want to implement one or multiple of the following:
- Published React components to shortcut the iframe process entirely
- More parameters on the
/viewer
route - custom background color, author flags/badge, ...