1.0.18 • Published 1 year ago

@machiavelli/steam-web v1.0.18

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

steam-web

steam-web is a Node.js module to interact with steamcommunity.com. It provides an easy API to important account data that is otherwise hard to obtain programmatically without scraping it.

Installation

npm i @machiavelli/steam-web

Features

  • New steam login support (JWT)
  • Login using access_token.
  • Login using refresh_token.
  • Re-use previous session.
  • Proxy support.

Usage

connect directly

import SteamWeb from "@machiavelli/steam-web";

// these tokens are obtainable through the steam-client
const token = access_token || refresh_token;

const steamWeb = new SteamWeb();
const session = await steamWeb.login(token);

connect through proxy

import SteamWeb from "@machiavelli/steam-web";

const info = {
  hostname: "br41.nordvpn.com",
  userId: "your-name@gmail.com",
  password: "abcdef12345124",
};
const agent = new SocksProxyAgent(info);

const steamWeb = new SteamWeb({ agent });
cosnt session = await steamWeb.login(token);

Re-use previous session to skip login

import SteamWeb from "@machiavelli/steam-web";
import { SocksProxyAgent } from "socks-proxy-agent";

// session is returned by login()
const steamWeb = new SteamWeb();
await steamWeb.setSession(session);

Methods

  /**
   * Re-use a previous session, thus we don't have to login again
   */
  setSession(session: Session): Promise<void>;

  /**
   * Login to Steamcommunity.com
   * token: access_token or refresh_token
   */
  login(token: string): Promise<Session>;

  /**
   * Logout and destroy cookies
   */
  logout(): Promise<void>;

  /**
   * Get games with cards left to farm
   */
  getFarmableGames(): Promise<FarmableGame[]>;

  /**
   * Get cards inventory
   */
  getCardsInventory(): Promise<Item[]>;

  /**
   * Change account profile avatar
   */
  changeAvatar(avatarURL: string): Promise<string>;

  /**
   * Clear account's previous aliases
   */
  clearAliases(): Promise<void>;

  /**
   * Change account's privacy settings
   */
  changePrivacy(privacy: ProfilePrivacy): Promise<void>;
1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago