Get server variables in a React Component
Is it possible to use the startup command variables inside of a React Component, and how?
In the attached example, the variable would be SRCDS_APPID

1 Reply
i guess calling the /api/application/servers/<id> endpoint would also give me the info i need, any way to do that securely or will i have to make a custom controller?
figured it out, not sure if this is unsecure but,
const variables = ServerContext.useStoreState((state) => state.server.data?.variables);
this seems to be a similar way pterodactyl gets the data for the "Setup" page, and works for my use case