Skip to content

barktler/API-Steam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API-Steam

Build Status codecov npm version downloads

💬 Steam APIs

Install

yarn add @barktler-api/steam
yarn add @barktler/core # Peer Dependency
# Or
npm install @barktler-api/steam --save
npm install @barktler/core --save # Peer Dependency

A request driver is also required, here we install and use the axios driver for example.

yarn add @barktler/driver-axios
# Or
npm install @barktler/driver-axios --save

Usage

import { axiosDriver } from "@barktler/driver-axios";
import { OwnedGamesDetail, SteamAPI } from "@barktler-api/steam";

(async () => {

    const steamApi: SteamAPI = SteamAPI.create('<Steam API Key>');
    steamApi.useDriver(axiosDriver);

    const detail: OwnedGamesDetail = await steamApi.getOwnedGames('<Steam ID>');

    console.log(detail);
})();

You can also declare a default driver for global request

import { Barktler } from "@barktler/core";
import { axiosDriver } from "@barktler/driver-axios";
import { OwnedGamesDetail, SteamAPI } from "@barktler-api/steam";

Barktler.useGlobalDefaultDriver(axiosDriver);

(async () => {

    const steamApi: SteamAPI = SteamAPI.create('<Steam API Key>');
    const detail: OwnedGamesDetail = await steamApi.getOwnedGames('<Steam ID>');

    console.log(detail);
})();

Releases

No releases published

Packages

No packages published