# mwp-user-profile

> A preact package that provide a button for user's specific actions

Latest version **1.1.0** (published 2019-02-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install mwp-user-profile
pnpm add mwp-user-profile
yarn add mwp-user-profile
bun add mwp-user-profile
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2019-02-21 |
| First published | 2018-07-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 212.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | WMS |
| Maintainers | webmobilesquad |

## Links

- npm: https://www.npmjs.com/package/mwp-user-profile
- npm.io page: https://npm.io/package/mwp-user-profile

## Dependencies (5)

- [preact](https://npm.io/package/preact.md) ^8.2.9
- [i18next](https://npm.io/package/i18next.md) ^15.0.4
- [classnames](https://npm.io/package/classnames.md) ^2.2.6
- [jwt-decode](https://npm.io/package/jwt-decode.md) ^2.2.0
- [i18next-browser-languagedetector](https://npm.io/package/i18next-browser-languagedetector.md) ^3.0.1

## Recent versions

- 1.1.0 (latest) — 2019-02-21
- 1.0.5 — 2018-10-16
- 1.0.4 — 2018-07-24
- 1.0.3 — 2018-07-23
- 1.0.2 — 2018-07-06
- 1.0.1 — 2018-07-06

## README

# Installation

`npm i mwp-user-profile`
or
`yarn add mwp-user-profile`

# Usage

```javascript
import { renderUserProfile } from "mwp-user-profile";
```

```javascript
renderUserProfile({
  container: document.querySelector("#user-profile"),
  idToken: "jwt-auth0-idToken",
  baseUrl: "https://mywebportal.domain.com/msn",
  onLogout: this.customFunction
});
```

- The _container_ is the element where the component will be attached;

- _idToken_ is a Json Web Token issued by auth0 that will be parsed by the component to display user info;

- _baseUrl_ is the base url for the "Profile" and "Logout" pages link;

- _onLogout_ is your custom code that will be called by clicking on the logout button.

## CLI Commands

```bash
# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# test the production build locally
npm run serve
```

For detailed explanation on how things work, checkout the [CLI Readme](https://github.com/developit/preact-cli/blob/master/README.md).

## Use dev module

### Using Yarn

> See [https://yarnpkg.com/lang/en/docs/cli/link/](https://yarnpkg.com/lang/en/docs/cli/link/)

### Using Npm

> See [https://docs.npmjs.com/cli/link](https://docs.npmjs.com/cli/link)

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