@speedcubing/donut
v0.0.2
Published
Speedcubing Online's API client toolkit.
Downloads
2
Readme
SCO Donut
Speedcubing Online's API client.
npm install --save @speedcubing/donut
Getting Started
The first thing you must do to use Donut is create a connection. To create a connection, you must have an API key and token OR a Speedcubing Online account. More information about that below.
import donut = require('@speedcubing/donut');
donut.connect({ /* OPTIONS */ })
.then((err, connection) => {
// ...
});
Options
apiKey
: An API key that is used to authenticate API requests. If anapiKey
value is provided, you must also provide anapiToken
value.apiToken
: Your API token, only required if you have provided an apiKey.email
: The email of your Speedcubing Online account. This can be used as an alternative to providing an API key and token, but it requires apassword
value as well.password
: Your SCO account's password.url
: The URL of Speedcubing Online, default:https://speedcubing-staging.herokuapp.com
Getting a User
By UUID
Using the connection.getUserByUuid
method, you can get a user by their UUID.
import donut = require('@speedcubing/donut');
donut.connect({ /* OPTIONS */ })
.then((err, connection) => {
connection.getUserByUuid('[uuid]', (err, user) => {
if (err) throw err;
// ...
});
});