@nivalit/keycloak-js-provider
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

Nivalit - Keycloak JS Provider

Simple Facade for simplify the authorization integration with keycloak identity provider.

Quick Start

For React Single Page Applications just use following snippet:

index.tsx

new KeycloakAuthBuilder(
  'http://authServerUrl:PORT',
  'clientId',
  'realmName',
  () =>
    ReactDOM.render(
      <React.StrictMode>
        <App />
      </React.StrictMode>,
      document.getElementById('root')
    )
)
  .addPublicPath('/signup')
  .build()
  .init()

Usage in code

Keycloak Authorization Service is a singleton instance that provides basic methods such as logout(), hasClientRoles(), getProfile() and isLoggedIn(). You can use it just from service instance in any place in code.

KeycloakAuthService.getInstance().logout()

Dependents (0)

Package Sidebar

Install

npm i @nivalit/keycloak-js-provider

Weekly Downloads

1

Version

1.1.1

License

ISC

Unpacked Size

103 kB

Total Files

8

Last publish

Collaborators

  • radoslaw.jajko.nivalit