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

@reminnor/kollega

v1.5.0

Published

This repo contains the frontend client for Remin Kollega.

Downloads

8

Readme

Kollega Client

Secure Chat for Health Personell

This repo contains the frontend client for Remin Kollega.

Get Started

The main starting point is to include the KollegaButton to your application.

import { KollegaButton } from '@reminnor/kollega'

...
<KollegaButton/>

In principle this is all you need to do as long as your users are already logged in with HelseID.

Authentication

Kollega uses HelseID to authenticate users and will by default automatically re-direct the user through our authentication flow the first time it is rendered on the a page. This process will authenticate the current session with Kollega and will only be required to do once.

The consequence of this process is that you will get a double render in your application. After the user has been redirected through your own login flow Kollega will start a new one on first render.

To prevent this double render, it's possible for you to tap into Kollega's authentication flow by redirecting the user directly to it after they come back from your flow.

login => your backend => HelseID => yourBackend => kollega => HelseID => kollega => logged in

You can access our authentication flow from the getAuthUrl(method:'helseid' | 'idporten', returnUrl: string) function

import { getAuthUrl, KollegaAuthProvider } from '@reminnor/kollega'


const authUrl = `http://your.auth.url?=redirect_url=${getAuthUrl('helseid', yourRedirectUrl)}`

Exports

Authentication Context

Kollega exports an authentication context that provides information regarding the users' logged in state. This information is polled in the background automatically if the context is in use.

import { KollegaAuthContext, KollegaAuthProvider } from '@reminnor/kollega'

ReactDom.render(
	....
	<KollegaAuthProvider>
	....
	</KollegaAuthProvider>
	....
)

....

const { isSignedIn, isLoading, me } = useContext(KollegaAuthContext)

Kollega Components

Kollega exports two main components.

KollegaButton - This component should be used if you want Kollega as an integrated service with a 'Kollega' button in the right hand corner.

Kollega - This component is the main Kollega component and renderes the full Kollega chat.

Interaction

Kollega exports kollegaSettings which exposes a few methods to interact with Kollega and the KollegaButton. kollegaSettings.button includes hide and minimize methods for the KollegaButton.

PDF Preview Support

Kollega uses pdf.js for previewing PDFs inline in the app. This is a massive library, which is why we've opted to require it to be included separately from the rest of the application.

To support PDF preview libs/pdf.worker.2.10.337.min.js must be served relative to your root folder.