-
-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[API] Route: /version #1222
Comments
Seems fine to me, how does one obtain the "version"? What does one do if version info is not available? |
also, I'd like if this could also have an area for features like "features":["WebRTC","Threads"] etc so I don't have to manually write code checking for that stuff lol |
One version is defined in package.json, but that doesn't seem to have changed from "1.0.0" which was set 2 years ago "scripts": {
...
"prebuild": "node -p \"'export const SERVER_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts",
...
} There's also the version that's displayed on startup: I think ideally this route would return a semver compatible version so it can be parsed in code and evaluated as before or after a known version |
Yeah, that would be very useful, but Im not sure if its in scope for this issue |
Is your feature request related to a problem? Please describe.
When developing an app meant to support several different Discord API implementations, sometimes on different versions, it would be very useful to be able to easily find the software you're working with and its version.
Why? Sometimes issues only arise only on one implementation, an implementation has extra features or a bug is found in an implementation. Even after bugs are fixed administrators do not update immediately and instances still run faulty versions. Knowing if you're working with a server on an affected version means the difference between your app working and crashing.
Describe the solution you'd like
A new route along the lines of
/api/version
, which returns the server's software (spacebar) and its version.A return schema may look like this:
(Other server implementations could then simply change the "server" field to identify themselves)
Describe alternatives you've considered
Why .well-known is not enough
As a convention,
.well-known/spacebar
does exist (though not always), but that doesn't expose the server version and is only available on the base url (http://spacebar.chat/.well-known/spacebar
exists, buthttp://old.server.spacebar.chat/.well-known/spacebar
orhttp://old.server.spacebar.chat/api/.well-known/spacebar
do not - and apps may only have the api url, not the base url)Other viable alternatives
However, adding a new route is preferable to changing an existing one - this would break existing apps relying on the old schema and new apps expecting them to have the new fields on old instances
Additional context
This was also discussed in the spacebar guild, see https://discord.com/channels/806142446094385153/806142446529806367/1289269996404473959
The text was updated successfully, but these errors were encountered: