npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mindtwo/px-user-widgets

v2.2.2

Published

Wrapper for PX User Widgets

Downloads

119

Readme

PX-User Widgets

Wrapper for reusing the px user widgets the same way on each client.

Installation

You can install the package via npm:

npm i @mindtwo/px-user-widgets --save

Usage

To fully use the widgets add the following snippets to your main view:

    <!-- Load PX-User Widgets -->
    <script src="https://user-frontend.api.pl-x.cloud/js/widget.js"></script>
<!-- Load PX-Mod-User Widget -->
<script>
    // include env vars for use in PX-User module
    window.PX_USER_DOMAIN = '{{ config('px-user.domain') }}';
    window.PX_USER_TENANT = '{{ config('px-user.tenant') }}';
    window.PX_USER_STAGE = '{{ config('px-user.stage') }}';
</script>

Add a widget to the page

First you need to import the script inside your main js file. This can be e.g. the entry point of your vite/mix build pipeline. You can do this by adding the follwing line:

import '@mindtwo/px-user-widgets'

The package will register custom components for you. To use a component simply add teh following to your DOM

<px-user-login data-containerId="login-modal" data-app-url="your app url" />

The value for container id should be a unique DOM-Element id on your page. The package provides the following elements:

<px-user-activate-user />

<px-user-forgot-password />

<px-user-set-password />

<px-user-admin-login />

Element Attributes

You can add the following attributes to a custom element:

  • data-containerId: Unique id for the DOM Element

  • data-app-url: The url of the app you wish to send requests to

  • data-token (only for set-password and activate-user): Token used to authenticate the request

  • stage (optional): The value for PX User Stage if set you can remove window.PX_USER_STAGE = ... from the snippet above

  • tenant (optional): The value for PX User Tenant if set you can remove window.PX_USER_TENANT = ... from the snippet above

  • domain (optional): The value for PX User Domain if set you can remove window.PX_USER_DOMAIN = ... from the snippet above

Login a user

If the user is logged in successfully via px-user-login the element fires a global event with the name px-user-loggedIn. Inside the CustomEvent.detail the dispatch stores the retrived token data from PX Users API.

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

  • [mindtwo GmbH][link-author]
  • [All Other Contributors][link-contributors]

License