By default, Roblox doesn’t provide API Dump / Reflection Metadata information to us within Roblox. This can be problematic for plugins that need it, as they either have to be manually updated every time one of these changes, or download the information through HttpService, which requires developers to toggle it on in every place they want to use the plugin in.
I decided to write a bot to automatically upload ReflectionMetadata, the API Dump, and class icons to Roblox whenever it updates, as there are a number of cool existing and potential plugins that need this information E.g.:
Custom Insert Object widget (API dump and class icons)
Custom Explorer widget (class icons)
Custom Properties (API dump and Reflection Metadata)
You can now access this information by requiring a public module from the site (InsertService was not an option as it disallows inserting scripts). As per woot3’s suggestion, the API dump and ReflectionMetadata are provided in the exact same format as the official API dump and ReflectionMetadata xml file. You can write your own wrapper to change the format of the data so it’s easier to use, and I may provide a separate module in the future that does this for you out of the box.
Example Code:
local info = require(2247441113)
local classIcon20AssetId = info.ClassIcons[20]
print(classIcon20AssetId)
=> 2254548328
local instanceApiInfo = info.ApiDump.Classes[1]
print(instanceApiInfo.Superclass)
=> <<<ROOT>>>
local reflectionInfo = info.ReflectionMetadata
for _,classInfo in pairs(reflectionInfo.Classes) do
print(classInfo.Name)
end
=> BindableFunction, etc
Does your bot auto upload new instance icons? The current system I use for my plugin uses @Anaminus’ sprite sheet from his API websites GitHub, paired with his GitHub repository’s json list of updated instance info. If yours uploads new icons when new instances come out I might switch over
I think you can require public module ids on the client. If not then you can insert it with InsertService on game start up or you should be able to pass the data from the server without any modifications.
Even if it is possible, inserting models through the client is bad practice – you should insert on the server and then only pass the data you care about to the client.
What’s wrong with inserting this module on server start up and requiring it on the client? It’s not anything with sensitive data. It’s just an API dump. Doing extra work to get the data to the client via Remotes sounds like a waste of time when the data is already in an easy-to-consume format.
I think inserting models should generally be avoided anyway, and usually what you’re suggesting is the best way to do it, but I don’t think that should apply as an absolute rule to all situations.
How can you insert on the server in a group game? I added the model into my inventory and I still got errors for “Asset is not trusted for this place” even though I am the group owner
I’m not sure if there’s a way to do that. If you really need the whole API dump on the client then you might have to use remotes. The API dump is in a fairly straightforward format though so you should be able to just pass the module data from require into a remote and receive it on the client, assuming the data isn’t too much to send.
As long as you require ApiDump on the server (ideally near startup) then you can call ApiDump on the client at any time and it’ll get a copy of the API Dump.