1.1.2 • Published 6 years ago

dsc-auth v1.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

DSCAuth

DSCAuth is an Oauth platform built on top of Qr Codes to integrate all the products of DSC VIT.

DSCAuth is built to overcome the hassle of registrations and logging in for various events and products managed by DSC.

Features:

  • It allows any user registered with connectX to authenticate any DSC product or registration form by just scanning a Qr code .
  • DSCAuth is concurrently built for both ES5 and ES6 using typescript and fuse-box.
  • It can integrate into anything from a jquery website to a react PWA.
  • It also has typescript typings , so it can support Angular .

Getting Started:

Usage with ES5 :

Include the minified version to HTML from CDN.

<script src="https://cdn.jsdelivr.net/npm/dsc-auth/dist/dscAuth.js"></script>

Add a script to initialize the library and handle the data.

<script>

        // Instantiate the object
        let Authentication=new Auth("<----API KEY---->");

        /* Initialize by providing the details handler
           Details will be logged when you scan the qr with connectX */
        Authentication.init(function(details){
            console.log(details);
        },true);

        // Fetch the the Qr code and handle the base64 image.
        Authentication.getQr().then(function(image){
            let img=document.createElement('img');
            img.src="data:image/png;base64,"+image;
            document.body.appendChild(img);
        });

</script>

Usage with ES6 :

Install the package from npm repository.

npm install dsc-auth

Import the library & Add a script to initialize the library and handle the data.

import Auth from 'dsc-auth'

// Instantiate the object
let Authentication=new Auth("<----API KEY---->");

/* Initialize by providing the details handler
Details will be logged when you scan the qr with connectX */

Authentication.init(function(details){
    console.log(details);
},true);

// Fetch the the Qr code and handle the base64 image.
Authentication.getQr().then(function(image){
    let img=document.createElement('img');
    img.src="data:image/png;base64,"+image;
    document.body.appendChild(img);
});

API Documentation :

Contributing :

Setup local development environment :

1) Install the dependencies :

npm install

2) Start the local development server :

npm start

3) Build the package :

npm run build

Publishing to npm :

1) Bump the version of the package by using

npm version <type of update>

2) Push the update to npm

npm publish

Developers :

Vineeth , Samyak