You probably shouldn’t directly use any of these. Most of them are used internally and exposed for advanced users.

[async] loginAnonymously

This lets you login anonymously. It returns a response from the auth services command.

import { loginAnonymously } from 'yolkbot/api';

let response = await 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.

[async] loginWithCredentials

This lets you login with a specified email and password.

import { loginWithCredentials } from 'yolkbot/api';

let response = await loginWithCredentials('email@example.com', 'ThisIsAPassword123!');
console.log(response);

This returns information about the account.

[async] loginWithRefreshToken

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 { loginWithRefreshToken } from 'yolkbot/api';

let response = await loginWithRefreshToken('some-VeRy-L0ng-rAndomTexT-heRe');
console.log(response);

This returns information about the account.

[async] createAccount

This allows you to create an account.

import { createAccount } from 'yolkbot/api';

let response = await createAccount('email@example.com', 'ThisIsAPassword123!');
console.log(response);

It returns the same thing as “loginWithCredentials”.

[async] queryServices

This lets you directly query the services socket.

import { queryServices } from 'yolkbot/api';

let response = await queryServices({ cmd: 'auth', firebaseToken: '...' });
console.log(response);

This is mostly used internally, but allows you to do things like play Chikn Winner.

Additional Arguments

Each of these take two extra arguments at the end in the following order:

  • proxy (string): A socks4 or socks5 proxy to use for the request.
  • instance (string): The instance of Shell Shockers to use, default shellshock.io.