Skip to content

steamguard-totp/steamguard-totp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

steamguard-totp

Promise-based JS implementation of Steam's mobile two factor authentication

Build Status

Installation

yarn add steamguard-totp

Usage

Normal usage

const { generateCode } = require('steamguard-totp');

const shared_secret = '8cr0T+zCLiaSdo1E+Alp7nzAPno=';

// async/await style
(async () => {
  const code = await generateCode(shared_secret);
  console.log(code);
})();

// promise style
generateCode(shared_secret)
  .then((code) => console.log(code));

For time travelers

const { generateCodeForTime } = require('steamguard-totp');

const shared_secret = '8cr0T+zCLiaSdo1E+Alp7nzAPno=';
const timestamp = 1516070462; // Unix timestamp (seconds)

const code = generateCodeForTime(shared_secret, timestamp);
console.log(code); // WMJ5T

About

JS implementation of Steam's mobile two factor authentication

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published