mwp-user-profile
v1.1.0
Published
A preact package that provide a button for user's specific actions
Downloads
8
Readme
Installation
npm i mwp-user-profile
or
yarn add mwp-user-profile
Usage
import { renderUserProfile } from "mwp-user-profile";
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
# 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.