Hytale Api - Node.js client for Hytale Official API
Created by mTxServ and Hytale.game. With this SDK, you can consume the official Hytale API in Node.js (javascript).
This SDK is used in the Hytale Bot Discord
project which is an example implementation of a bot which allow user to show latest 3 blogposts from official Hytale website. See example
For Node.js
Then install it via:
npm install hytale-api-sdk --save
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify
,
perform the following (assuming main.js is your entry file, that's to say your javascript file where you actually
use this library):
browserify main.js > bundle.js
Then include bundle.js in the HTML pages.
Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:
module: {
rules: [
{
parser: {
amd: false
}
}
]
}
Please follow the installation instruction and execute the following JS code:
var HytaleApi = require('hytale-api-sdk');
var api = new HytaleApi.ArticlesApi();
var slug = "creating-creature-sounds-for-hytale"; // {String} Slug of article
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully');
console.log(data);
}
};
api.getArticleBySlug(slug, callback);
All URIs are relative to https://hytale.com/api
Class | Method | HTTP request | Description |
---|---|---|---|
HytaleApi.ArticlesApi | getArticleBySlug | GET /blog/post/slug/{slug} | |
HytaleApi.ArticlesApi | getArticles | GET /blog/post/published | |
HytaleApi.ArticlesApi | getArticlesOfMonthAndYear | GET /blog/post/archive/{year}/{month}/ | |
HytaleApi.JobsApi | getJobs | GET /job/listing |
All endpoints do not require authorization.