@ecomplus/auth
v1.0.1
Published
JS client for E-Com Plus admin authentication
Downloads
30
Maintainers
Readme
E-Com Plus Auth
JS client for E-Com Plus admin authentication
Usage
The @ecomplus/auth
package can be used to handle login and persist/manipulate admin account data and resources permitted trough E-Com Plus Store API.
It's available for both Node.js and browser environments.
Example
import ecomAuth from '@ecomplus/auth'
ecomAuth.login(localStorage.getItem('username'), localStorage.getItem('password'))
ecomAuth.on('login', self => {
console.log('Login OK!', self)
ecomAuth.createEcomplusSession().then(r => console.log(r))
})
ecomAuth.on('logout', self => {
console.log('Out!', self)
})