A Node.js wrapper for Team Fortress 2 schema-related methods from the Steam Web API.
Using npm:
$ npm install @mann-conomy/tf-schema
Using yarn:
$ yarn add @mann-conomy/tf-schema
Using npm:
$ npm test
Using yarn:
$ yarn test
Fetching the full Team Fortress 2 item schema from the Steam Web API.
import { SchemaClient } from "@mann-conomy/tf-schema";
const client = new SchemaClient(process.env.STEAM_WEB_API_KEY!);
(async() => {
try {
const schema = await client.getItemSchema();
const item = schema.getItemByName("Team Captain", true);
console.log(item?.defindex, item?.item_class);
} catch (error) {
if (error instanceof Error) {
console.error("Error fetching the item schema", error.message);
}
}
})();
Importing the Team Fortress 2 item schema from a static source, such as a local JSON file.
import { ItemSchema } from "@mann-conomy/tf-schema";
(async() => {
try {
const schema = await ItemSchema.import("./assets/static/schema.json");
const name = schema.getQualityNameById(11);
console.log(name); // Strange
} catch (error) {
if (error instanceof Error) {
console.error("Error importing the item schema", error.message);
}
}
})();
Some more examples are available in the examples and test directories.
See the Wiki pages for further documentation.
The type descriptions used in this project are based on the work of the amazing contributors over at the Team Fortress 2 Wiki.
Huge thanks to them for their dedication and detailed documentation!
Copyright 2025, The Mann-Conomy Project