2.3.8 • Published 5 months ago

@moser-inc/moser-labs-custom-elements v2.3.8

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

Moser Labs Custom Elements

This package contains a collection of custom elements that can be used in any web application.

Installation

npm i @moser-inc/moser-labs-custom-elements

Usage

For these custom elements to function properly, you must first authenticate the user with Keycloak before calling the provided registerCustomElements function, passing the Keycloak instance to it.

import Keycloak from 'keycloak-js';
import { registerCustomElements } from '@moser-inc/moser-labs-custom-elements';

const keycloak = new Keycloak('/keycloak.json');

keycloak.init({ onLoad: 'login-required' }).then((isAuthenticated) => {
  if (!isAuthenticated) return;

  registerCustomElements({ keycloak });
});

API

In order for the custom elements to use the correct instance for calling API endpoints and getting profile pictures, pass the apiUri option to registerCustomElements, using an environment variable for it to be dynamic between staging and production. It defaults to using window.location.origin.

registerCustomElements({ keycloak, apiUri: import.meta.env.VITE_API_URI });

External

When using a Vue + PrimeVue based application, a version of the package is provided that marks these dependencies as external to drastically reduce the bundle size.

import { registerCustomElements } from '@moser-inc/moser-labs-custom-elements/external';
2.3.0

11 months ago

2.3.2

11 months ago

2.3.1

11 months ago

2.3.4

10 months ago

2.3.3

11 months ago

2.3.6

5 months ago

2.3.5

7 months ago

2.3.8

5 months ago

2.3.7

5 months ago

1.2.0

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

2.2.1

1 year ago

2.0.3

1 year ago

2.2.0

1 year ago

2.0.2

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.1.0

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.0

2 years ago