Creeper Host API wrapper in TypeScript
I've had a server on Creeper Host for around eight years now, and have used it for small side projects and hackathons. Lately, I've been trying to automate more of my life and discovered that the API their in-house control panel uses is available for general use. I'm making this post in case someone else ever wants to interact with their API via JavaScript. Maybe someday I'll create a proper repository, but for now my wrapper is incomplete and it's easier to just include here. It was also a good chance to write some TypeScript from scratch, something I haven't had the opportunty to do very much of.
To get started, you'll need to generate a Developer Token on the control panel. Navigate to the Sub-accounts
page and generate a new API key at the bottom of the page:
Also, install axios (or change the below code to your favorite request library, I don't care):
Then, incorporate these two files:
Finally, create an instance via new Client({ apiKey, apiSecret, instanceId });
You can use it by finding what you want to call on the Creeper Host docs and accessing that on the client; I purposefully used the same naming scheme. For example,
corresponds to the https://api.creeper.host/os/getram endpoint.
I removed some methods from the above to avoid cluttering this page, but it's straight forward to add your own. If you really want to use this, contact me and I can set up a repo for us to collaborate. Also, if you have suggestions on how I can improve this, let me know via email or on Twitter.