Skip to content

API for authenticating with Roll20, retrieving session and firebase keys.

License

Notifications You must be signed in to change notification settings

justas-d/roll20auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

roll20auth

NPM GitHub

Installation

npm install --save roll20auth

Usage

async/await

const roll20auth = require("roll20auth");

try {
    const key = await roll20auth.getSessionKey(username, password);
    /*
        key.makeCookies();
        key.getRackSession();
        key.getTempAuth();
        key.getCfduid();
    */

    const campaignData = await roll20auth.getCampaignData(key, campaignId);

    /*
        campaignData.getGNTKN();
        campaignData.getCampaignStoragePath();
        campaignData.getPlayerId();
        campaignData.getPlayerAccountId();
    */
} catch(err) {
    /* ... */
}

Promises

const roll20auth = require("roll20auth");
roll20auth.getSessionKey(username, password)
    .then(key => {
        /*
            key.makeCookies();
            key.getRackSession();
            key.getTempAuth();
            key.getCfduid();
        */

        roll20auth.getCampaignData(key, campaignId)
            .then(campaignData => {
                /*
                    campaignData.getGNTKN();
                    campaignData.getCampaignStoragePath();
                    campaignData.getPlayerId();
                    campaignData.getPlayerAccountId();
                 */
            }).catch(console.log)
    }).catch(console.log);

Testing

Make sure you have a .env file in the project root folder with the following data:

ROLL20_USERNAME=""
ROLL20_PASSWORD=""

ROLL20_USERNAME_UNESCAPED=""
ROLL20_PASSWORD_UNESCAPED=""

ROLL20_CAMPAIGN_ID=""

EXPECTED_CAMPAIGN_STORAGE_PATH=""
EXPECTED_PLAYER_ID=""
EXPECTED_PLAYER_ACC_ID="'

Run the tests

npm run test

License

MIT

About

API for authenticating with Roll20, retrieving session and firebase keys.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published