Consolidate /api/v1/instance, /nodeinfo/2.0.json, and /api/statusnet/config.json
Instance meta endpoints:
- /api/v1/instance
- /nodeinfo/2.0.json
- /api/statusnet/config.json
The frontend needs to request all 3 of these endpoints in order for it to function. That's 3 HTTP requests to get instance info. Each one has some data that's exclusive to it, while most of the data is overlapping and duplicated.
I understand there are historical reasons for all 3 endpoints, but for a modern frontend I'm wondering if they can be consolidated into 1 HTTP request.
/api/v1/instance
Exclusive values:
-
urls.streaming_api
, Websocket streaming URI (eg "wss://example.tld").
/nodeinfo/2.0.json
Exclusive values:
-
metadata.features
, needed for conditionally rendering certain UI features based on Pleroma settings. -
metadata.federation
, needed to display federation restrictions on the About page.
/api/statusnet/config.json
Exclusive values:
- vapidPublicKey, required for push notifications to work.
There are other exclusive values, but I tried to showcase the ones that seem especially necessary. There are other "nice to have" fields like nodeinfo's restrictedNicknames
field which lets you do username validation on the frontend.
Most essential values can be found in /api/v1/instance, which you'll want to pull from anyway if you intend to support Mastodon.
My instinct is that they should all be smashed into /api/v1/instance. Maybe under a pleroma
tree to keep it clean.