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

@myhealth-belgium/webcomponent-integration

v2.0.0

Published

Interfaces to use when creating a custom component for My Health

Downloads

27

Readme

MyHealth Belgium web component integration library

This is a mandatory API, each web-component that needs to be integrated in myhealth.belgium.be should declare following:

Properties

Language

The language always holds the current language as a value, which means it can change over time if the user changes his/her preferred language. The web component must change it’s displayed translations whenever the value changes. The values of the language property are defined in the Language enum. It's values can be:

  • en
  • de
  • fr
  • nl

Environment

The environment property holds the environment where the application is currently running. Possible values of this property are defined by the Environment enum. Currently, the possible values are:

  • prod
  • acc
  • int
  • dev

For production, acceptation, integration and development respectively.

Access token holder

The AccessTokenHolder is used to have a callback mechanism to always retrieve the current valid access-token. When you perform an api from the webcomponent that needs authentication, you can retrieve the Bearer-token by calling the getAccessToken() method from the AccessTokenHolder.

The interface

interface AccessTokenHolder {
    getAccessToken(): String
}

Example usage of webcomponent on a page

<my-component
        environment="prod"
        language="nl"
        access-token-holder={this.accessTokenHolder}
</my-component>

The AccessTokenHolder will be implemented by the user of the web component, in our case myhealth.belgium.be.

Component specific API (data exchange)

A component can require additional data to be exchanged between the container and itself. This should happen according to the Web Component Specification standard meaning:

Data should be provided to the web component by setting a property value. E.g.

<my-component
    personalInfo={this.personalInfo}>
</my-component>

Data from the web component to the container should be implemented by an event. E.g.

<my-component
        onProfileSelected={event => this.selectProfile(event)}>
</my-component>

Intent and concerns of this library

The intent of this library is to provide a standard in communication between the webcomponent and the integrating platform. The provided access token by the AccessTokenHolder needs to be discussed with both client and provider of the web component. This is out of scope for this library.

How to install

npm i @myhealth-belgium/webcomponent-integration