Skip to content

ecomplus/auth

Repository files navigation

E-Com Plus Auth

Publish CodeFactor npm version License AGPL

JS client for E-Com Plus admin authentication

CHANGELOG

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)
})