You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

roll20auth

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

roll20auth

Provides an API to authenticate with Roll20 and retrive session and firebase keys.

2.1.0
latest
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 25 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts