The API class is very useful for login and account management.
import API from 'yolkbot/api';
const api = new API();
This will create a new API instance that you can use to interact with the Shell Shockers API. From there, all methods exist on the api object, which you can use to perform various actions.
The first parameter is an optional object that can contain any combination of the following properties:
instance - the instance of the game to use, default: 'shellshock.io'protocol - the protocol to use, default: 'wss'socksProxy - the socks5 (or socks5h) proxy to use for shell auth requests, default: null (no proxy)maxRetries - the max retries for failed shell auth requests, default: 5suppressErrors - whether to suppress console auth errors, default: falseconnectionTimeout - the timeout in milliseconds for connecting to the services server, default: 5000For example:
import API from 'yolkbot/api';
const api = new API({
instance: 'egg.dance',
socksProxy: 'socks5://user:password@proxy.com'
});
Now, here's what you can do with the API class!
This lets you login anonymously. It returns a response from the auth services command.
import API from 'yolkbot/api';
const api = new API();
const response = await api.loginAnonymously();
console.log(response);
This returns information about the newly created anonymous account.
Note that Firebase, the database provider of the game, ratelimits anon accounts created every hour.
This lets you login with a specified email and password.
import API from 'yolkbot/api';
const api = new API();
const response = await api.loginWithCredentials('email@example.com', 'ThisIsAPassword123!');
console.log(response);
This returns information about the account.
This lets you login using a Firebase refresh token
You can learn about obtaining those by looking at the loginWithRefreshToken docs for the Bot.
import API from 'yolkbot/api';
const api = new API();
const response = await api.loginWithRefreshToken('some-VeRy-L0ng-rAndomTexT-heRe');
console.log(response);
This returns information about the account.
This allows you to create an account.
import API from 'yolkbot/api';
const api = new API();
const response = await api.createAccount('email@example.com', 'ThisIsAPassword123!');
console.log(response);
It returns the same thing as "loginWithCredentials".
This sends the verification email to the email address on the account.
import API from 'yolkbot/api';
const api = new API();
await api.createAccount('email@example.com', 'ThisIsAPassword123!');
const response = await api.sendEmailVerification();
console.log(response);
This lets you directly query the services socket.
import API from 'yolkbot/api';
const api = new API();
const response = await api.queryServices({ cmd: 'auth', firebaseToken: '...' });
console.log(response);
This is mostly used internally, but allows you to do things like play Chikn Winner without creating a Bot.
The API class is very useful for login and account management.
import API from 'yolkbot/api';
const api = new API();
This will create a new API instance that you can use to interact with the Shell Shockers API. From there, all methods exist on the api object, which you can use to perform various actions.
The first parameter is an optional object that can contain any combination of the following properties:
instance - the instance of the game to use, default: 'shellshock.io'protocol - the protocol to use, default: 'wss'socksProxy - the socks5 (or socks5h) proxy to use for shell auth requests, default: null (no proxy)maxRetries - the max retries for failed shell auth requests, default: 5suppressErrors - whether to suppress console auth errors, default: falseconnectionTimeout - the timeout in milliseconds for connecting to the services server, default: 5000For example:
import API from 'yolkbot/api';
const api = new API({
instance: 'egg.dance',
socksProxy: 'socks5://user:password@proxy.com'
});
Now, here's what you can do with the API class!
This lets you login anonymously. It returns a response from the auth services command.
import API from 'yolkbot/api';
const api = new API();
const response = await api.loginAnonymously();
console.log(response);
This returns information about the newly created anonymous account.
Note that Firebase, the database provider of the game, ratelimits anon accounts created every hour.
This lets you login with a specified email and password.
import API from 'yolkbot/api';
const api = new API();
const response = await api.loginWithCredentials('email@example.com', 'ThisIsAPassword123!');
console.log(response);
This returns information about the account.
This lets you login using a Firebase refresh token
You can learn about obtaining those by looking at the loginWithRefreshToken docs for the Bot.
import API from 'yolkbot/api';
const api = new API();
const response = await api.loginWithRefreshToken('some-VeRy-L0ng-rAndomTexT-heRe');
console.log(response);
This returns information about the account.
This allows you to create an account.
import API from 'yolkbot/api';
const api = new API();
const response = await api.createAccount('email@example.com', 'ThisIsAPassword123!');
console.log(response);
It returns the same thing as "loginWithCredentials".
This sends the verification email to the email address on the account.
import API from 'yolkbot/api';
const api = new API();
await api.createAccount('email@example.com', 'ThisIsAPassword123!');
const response = await api.sendEmailVerification();
console.log(response);
This lets you directly query the services socket.
import API from 'yolkbot/api';
const api = new API();
const response = await api.queryServices({ cmd: 'auth', firebaseToken: '...' });
console.log(response);
This is mostly used internally, but allows you to do things like play Chikn Winner without creating a Bot.