KeycloakTS
Typescript porting of Keycloak javascript client
:construction: WIP: Under development :construction:
![NPM (scoped)](https://img.shields.io/npm/v/@react-keycloak/keycloak-ts?label=npm%20%7C%20keycloak-ts)
![Github Issues](https://img.shields.io/github/issues/react-keycloak/keycloak-ts.svg)
![Gitter](https://img.shields.io/gitter/room/react-keycloak/community)
Table of Contents
Install
yarn add @react-keycloak/keycloak-ts
or
npm install @react-keycloak/keycloak-ts
Getting Started
KeycloakTS provides a porting of the original Keycloak javascript adapter to allow better extensibility and usage on different platform by using custom adapters.
Create a custom KeycloakAdapter
Create a class which implements the KeycloakAdapter
interface
import type { KeycloakAdapter } from '@react-keycloak/keycloak-ts';
class MyCustomAdapter implements KeycloakAdapter {
...
};
export default MyCustomAdapter;
Setup Keycloak instance
import { KeycloakClient } from '@react-keycloak/keycloak-ts';
import MyCustomAdapter from './adapter.ts';
const keycloak = new KeycloakClient({
url: 'http://keycloak-server/auth',
realm: 'kc-realm',
clientId: 'web'
});
keycloak.init({
adapter: MyCustomAdapter,
});
export default keycloak;
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT