Giter VIP home page Giter VIP logo

steam-verificator's Introduction

steam-verificator

A module to verify Steam accounts

This module, in conjunction with node-steam allows you to verify a Steam account for further usage on an external service. The procedure is simple:

  • The user adds the Steam bot.
  • The Steam bot sends the user a code.
  • The user enters that code on the external service.
  • The user's Steam account is verified.

This only makes sense on a service where a web interface is not a possibility, as using OAuth would be a better method. Because of that, and because this code is messy and lacks better documentation, I won't publish this module to the npm registry; though I might at some point.

Installation

$ npm install --save git+https://github.com/MeLlamoPablo/steam-verificator.git

Usage

const steamVerificator = require("steam-verificator");

let verificator = new steamVerificator.Verificator({
	trigger: steamVerificator.Trigger.FriendRequest,
	triggerOptions: {
		secondService: "My App"
	},
	steamClient: steamClient,
	steamUser: steamUser,
	steamFriends: steamFriends
});

// Because the Verificator is using Trigger.FriendRequest, whenever an user adds the bot,
// it will send back the code to them. After the user passes back the code:

function onUserCodeEnter(code) {
	let steamID = verificator.verify(code);
	
	if (steamID !== null) {
	    // Verification process successful.
	    // steamID is the user's steam id.
	} else {
	    // Verification process failed.
	}
}

See example.js for a full example file.

Options

Here's a full list of the options accepted by the constructor:

  • steamClient, steamUser and steamFriends are defined by node-steam.
  • trigger: either steamVerificator.Trigger.FriendRequest (the bot sends the code when the user adds it to their friend list) or steamVerificator.Trigger.Manual (you need to run Verificator.trigger(user), where user is the user's Steam ID).
  • triggerOptions
    • secondService: the name of the external service.
    • ignoredUsers: an array of steam ids that the bot will ignore upon friend request.
  • codeLength: the length of the code. Default is 10.

License

Apache-2.0 © Pablo Rodríguez

steam-verificator's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.