# package_murugoauth_web-js

> Package to authenticate user on Murugo Cloud.

Latest version **2.4.0** (published 2020-05-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install package_murugoauth_web-js
pnpm add package_murugoauth_web-js
yarn add package_murugoauth_web-js
bun add package_murugoauth_web-js
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.4.0 |
| Published | 2020-05-11 |
| First published | 2020-04-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Prince Dacy |
| Maintainers | princedacy |

## Links

- npm: https://www.npmjs.com/package/package_murugoauth_web-js
- Repository: https://github.com/RWBuild/package_MurugoAuth_web-JS
- Homepage: https://github.com/RWBuild/package_MurugoAuth_web-JS#readme
- Issues: https://github.com/RWBuild/package_MurugoAuth_web-JS/issues
- npm.io page: https://npm.io/package/package_murugoauth_web-js

## Recent versions

- 2.4.0 (latest) — 2020-05-11
- 2.3.3 — 2020-05-08
- 2.3.2 — 2020-05-08
- 2.3.1 — 2020-05-08
- 2.3.0 — 2020-05-08
- 2.2.9 — 2020-05-08
- 2.2.8 — 2020-05-08
- 2.2.7 — 2020-05-08
- 2.2.6 — 2020-05-08
- 2.2.5 — 2020-05-07
- 2.2.4 — 2020-05-07
- 2.2.3 — 2020-05-06
- 2.2.2 — 2020-05-06
- 2.2.1 — 2020-05-06
- 2.2.0 — 2020-05-06
- … 12 more at https://npm.io/package/package_murugoauth_web-js/versions

## README

To install the plugin, do the following:

```javascript
const murugoAuth = require("package_murugoauth_web-js");
```

The package is rendered by calling `murugoAuth`.

## Reference

- `auth.loggedIn()`, returns user's data and store them in localStorage.
- `auth.logOut(token)`, logs the user's session out on Murugo Cloud. `token` parameter is sent along with this function.

## Example

To access user's data, you can do the following:

### Javascript

```javascript
const murugoAuth = require("package_murugoauth_web-js");
const auth = new murugoAuth();
// Function to identify user's data and save them in localStorage.
auth.loggedIn();
// Get murugo_user stored in localStorage under 'murugo_user' key.
let murugo_user = JSON.parse(localStorage.getItem("murugo_user"));
```

To logout:

````javascript
logout() {
    // Logged in token of the user.
      let token = this.token
      const murugoAuth = require("package_murugoauth_web-js");
      const auth = new murugoAuth(token);
      // Log out function. token as parameter.
      auth.logOut(token);
    }
    ```
````

---
_Source: https://npm.io/package/package_murugoauth_web-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
