0.0.6 • Published 5 years ago
verzth-tcx-js v0.0.6
tcx-js
Javascript Library for TCX Authentication Module, it use in client side to help make auth simpler.
Dependencies
Installation
NPM
npm i verzth-tcx-js
or
npm i --save verzth-tcx-js
How to Use:
Add script in your html.
<script src="{file_path}/tcx.js"></script>
Initialize tcx object with params, it will use default value if you don't provide params.
var tcx = new TCX({ url : '', app_id : '', secret_key : '', public_key : '', auth : 'param', // available param, time and none. master_key : '' });
Available function:
- getAppID() : string
- getAppPass(object: Object) : string
- getToken(callback)
- getRefreshToken(callback)
- clearToken()
- getMasterToken() : string
- getTime() : string // return tcx_datetime value, but you need to assign it to your parameter (assign it before call getAppPass!).
- appendTime(object: Object) : object // return your parameter with tcx_datetime injected (assign it before call getAppPass!).
Note: This module not handle your http request, it just help you create the credentials.
TCX JS also provide service for Angular 7, available in this repository @Angular TCX JS