https://github.com/ecomplus/auth
JS client for E-Com Plus admin authentication
https://github.com/ecomplus/auth
admin-login authentication ecomplus
Last synced: about 1 month ago
JSON representation
JS client for E-Com Plus admin authentication
- Host: GitHub
- URL: https://github.com/ecomplus/auth
- Owner: ecomplus
- License: agpl-3.0
- Created: 2019-10-28T19:11:43.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-03-17T02:22:12.000Z (2 months ago)
- Last Synced: 2025-03-17T22:24:29.880Z (2 months ago)
- Topics: admin-login, authentication, ecomplus
- Language: JavaScript
- Size: 2.61 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# E-Com Plus Auth
[](https://github.com/ecomplus/auth/actions?workflow=Publish) [](https://www.codefactor.io/repository/github/ecomplus/auth) [](https://www.npmjs.org/@ecomplus/auth) [](https://opensource.org/licenses/AGPL-3.0)
JS client for E-Com Plus admin authentication
[CHANGELOG](https://github.com/ecomplus/auth/blob/master/CHANGELOG.md)
## 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
```js
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)
})
```