Using CommonJS:

const {LoginApprover} = require('steam-session');

Using ES6 modules:

import {LoginSession} from 'steam-session';

The LoginApprover class can be used to approve a login attempt that was started with a QR code.

See

Example: approve-qr.ts

Hierarchy

  • LoginApprover

Constructors

  • Parameters

    • accessToken: string

      A valid access token for the account you want to approve logins for. This access token (not refresh token) must have been created using the MobileApp platform type.

    • sharedSecret: string | Buffer

      Your account's TOTP shared secret. If this is a string, it must be hex- or base64-encoded.

    • Optional options: ConstructorOptions

    Returns LoginApprover

    Constructs a new LoginApprover instance. Example usage:

    import {LoginApprover} from 'steam-session';

    let approver = new LoginApprover('eyAid...', 'oTVMfZJ9uHXo3m9MwTD9IOEWQaw=');

    An Error will be thrown if your accessToken isn't a well-formed JWT, if it's a refresh token rather than an access token, or if it's an access token that was not generated using EAuthTokenPlatformType.MobileApp.

Properties

sharedSecret: string | Buffer

A string or Buffer containing your shared secret. This is automatically set by the constructor, but you can also manually assign it if you need to set a new shared secret for some reason.

If this is a string, it must be either hex- or base64-encoded.

_accessToken: string
_webClient: default
_handler: default

Accessors

  • get accessToken(): string
  • A string containing your access token. This is automatically set by the constructor, but you can also manually assign it if you need to set a new access token.

    An Error will be thrown when you set this property if you set it to a valid that isn't a well-formed JWT, if it's a refresh token rather than an access token, or if it's an access token that was not generated using EAuthTokenPlatformType.MobileApp.

    Returns string

  • set accessToken(token): void
  • Parameters

    • token: string

    Returns void

Methods

  • Parameters

    • qrChallengeUrl: string

      The QR challenge URL from a startWithQR call

    Returns Promise<AuthSessionInfo>

    Retrieves info for an auth session given a QR challenge URL. Once you call this, remoteInteraction will be emitted. If the QR auth session was initiated within a legitimate Steam client or website, a loading indicator will be overlayed on the QR code to indicate that the session is being dealt with on a mobile device.

Generated using TypeDoc