Atmosphere is filled with over dozen Steam packages which provide this functionality, however most of these packages are either outdated or lack even the basic description, such as a README file.
meteor add scholtzm:accounts-steam
Meteor.loginWithSteam(options, callback)
options
- object containing options, see below (optional)callback
- callback function (optional)error
-Meteor.Error
object if error occured;null
otherwise
Note: callback
will be only called if loginStyle
is set to popup
Template.myTemplateName.events({
'click #login-button': function() {
Meteor.loginWithSteam();
}
);
These options override service configuration stored in the database.
loginStyle
-redirect
orpopup
redirectUrl
- where to redirect after successful login
Note: redirectUrl
will be used only if loginStyle
is set to redirect
The value below can be only set via Accounts UI dialog or by inserting the service configuration directly to database:
timeout
- timeout value (in milliseconds) for the OpenID handshake
This package integrates with accounts-ui
and also provides configuration dialog. The configuration dialog contains field Timeout
, which can be used to adjust timeout value (in milliseconds) for the OpenID handshake.
You can also skip the config dialog by running a short snippet in your Meteor.startup
function, see below.
You can manually configure this package by upserting the service configuration on startup. First, add the service configuration package:
meteor add service-configuration
Then in your project:
if(Meteor.isServer) {
Meteor.startup(function () {
ServiceConfiguration.configurations.upsert(
{ service: 'steam' },
{
$set: {
loginStyle: 'redirect',
timeout: 10000 // 10 seconds
}
}
);
});
}
You will most likely want to do this to have your Steam login service always configured.
This package does not require your Steam API key, because the only information it provides is user's 64 bit Steam ID.
Retrieving user's profile information such as display name or avatar is up to you.
Ideally, you should at least retrieve user's profile information when he logs in for the very first time. This can be accomplished by utilizing Accounts.onCreateUser
(server-side).
If you wish to keep user's profile up-to-date, you can use Accounts.onLogin
(server-side) or different approach.
MIT. See LICENSE
.