1.5.0 • Published 2 years ago

@reminnor/kollega v1.5.0

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

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.

1.5.0

2 years ago

1.2.0

2 years ago

1.0.2

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

0.1.10

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.0

2 years ago