we-te-login

1.6.9 • Public • Published

We TE Login

NPM version NPM downloads MIT License

simple module for login into we (telecom egypt) using web automation with puppeteer

Installation

npm install we-te-login

Usage

const {login, loginWeb} = require('we-te-login');

// normal login useing functtion
login('022713XXXX', '*********').then((res) => {
    console.log(res);
    res->{
         number: '022713XXXX',
        password: 'T0da89******' //encrypted with 'we' encryption algorithm,
        token: 'eyJrdasdawddcvb...',
        customerId: '101101xxx',
        customerName: 'Ahmed'
    }
}).catch((err) => {
    console.log(err);
});

login('022713XXXX', '*********',{skipEncryption:true}).then((res) => {
    console.log(res);
    res->{
        number: '022713XXXX',
        password: '**********' //not encrypted,
        token: 'eyJrdasdawddcvb...',
        customerId: '101101xxx',
        customerName: 'Ahmed'
    }
}).catch((err) => {
    console.log(err);
});

// login using web automation with puppeteer
// NOTE !!!!!!!!!!!
// by default the module will use edg or chrome if installed and in default path
// if you want to use different browser you can pass the path to the browser to webBrowserPath
// just like the example below
loginWeb({webBrowserPath:'apps/browser/firefox.exe'}).then((res) => {
    console.log(res);
    res->{
         number: '022713XXXX',
        password: 'T0da89******' //encrypted,
        token: 'eyJrdasdawddcvb...',
        customerId: '101101xxx',
        customerName: 'Ahmed'
    }
}).catch((err) => {
    console.log(err);
});

Package Sidebar

Install

npm i we-te-login

Weekly Downloads

2

Version

1.6.9

License

ISC

Unpacked Size

8.27 kB

Total Files

7

Last publish

Collaborators

  • abdelrahman-tarek