logo bannerlogo banner
Page Navigator

Refresh tokens are very long strings that are used by Firebase (the game login manager) to authenticate users who have already logged in. The tokens are stored in the browser storage and used to generate authentication credentials. However, we can utilize this to be able to easily login to Google accounts without trying to integrate the OAuth flow.

To login with a refresh token, you can use the bot.loginWithRefreshToken method:

bot.loginWithRefreshToken('your-refresh-token');

You can extract a refresh token from the game by running this code:


const notLoggedIn = () => console.error('You do not appear to be logged in.');

const request = indexedDB.open('firebaseLocalStorageDb');

request.onsuccess = function(event) {
    const db = event.target.result;
    const transaction = db.transaction(['firebaseLocalStorage'], 'readonly');
    const store = transaction.objectStore('firebaseLocalStorage');

    const getAllKeysRequest = store.getAllKeys();

    getAllKeysRequest.onsuccess = function() {
        const getRequest = store.get(getAllKeysRequest.result[0]);

        getRequest.onsuccess = function() {
            const id = Math.random().toString(36).slice(2);
            window.copy = () => {
                document.getElementById(id).remove();
                navigator.clipboard.writeText(getRequest.result.value.stsTokenManager.refreshToken);
            }
            document.body.insertAdjacentHTML('beforeend', `<div style="position:absolute;top:0;left:0;width: 100%;height:100%;background:black;cursor:pointer;display:flex;justify-content:center;align-items:center;z-index:999999;" onclick="copy()" id="${id}"><h1 style="color:white;font-family:'Nunito';font-weight:bold;">click me to copy token!</h1></div>`);
        };

        getRequest.onerror = () => notLoggedIn();
    };

    getAllKeysRequest.onerror = () => notLoggedIn();
};

request.onerror = () => notLoggedIn();

Please note that you should be logged in to the account.