JavaScript / TypeScript
Quick start
Node.js and bundlers (ESM):
ts
import { NotFoundError, Umanthir } from "@umanthir/sdk";
const client = new Umanthir();
try {
const character = await client.characters.get("Njorn");
console.log(character.character_information.level);
} catch (error) {
if (error instanceof NotFoundError) console.log("No such character");
else throw error;
}CommonJS:
js
const { Umanthir } = require("@umanthir/sdk");
new Umanthir().worlds.list().then((worlds) => console.log(worlds.players_online));Browser:
html
<script>
const client = new Umanthir();
client.characters
.get("Njorn")
.then(console.log)
.catch((error) => {
if (error instanceof Umanthir.NotFoundError) console.log("No such character");
});
</script>Responses keep the exact shape of the Umanthir API: snake_case fields and ISO-8601 dates as strings. More examples are in examples/.
Next: Client options.