https://github.com/s3pweb/keycloak-admin-client-cjs
Keycloak Admin Client compiled in CommonJS.
https://github.com/s3pweb/keycloak-admin-client-cjs
commonjs keycloak nestjs
Last synced: 9 months ago
JSON representation
Keycloak Admin Client compiled in CommonJS.
- Host: GitHub
- URL: https://github.com/s3pweb/keycloak-admin-client-cjs
- Owner: s3pweb
- License: mit
- Created: 2022-12-21T10:51:06.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-19T08:40:34.000Z (over 1 year ago)
- Last Synced: 2025-04-13T19:48:54.514Z (about 1 year ago)
- Topics: commonjs, keycloak, nestjs
- Language: Shell
- Homepage:
- Size: 258 KB
- Stars: 21
- Watchers: 2
- Forks: 15
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Keycloak Admin Client in CommonJS
This lib exports the [@keycloak/keycloak-admin-client](https://www.npmjs.com/package/@keycloak/keycloak-admin-client)
(an ECMA Script module) as a CommonJS module, so it can be used in NestJS.
This repo is based on an idea by [Manuelbaun](https://github.com/Manuelbaun) on this issue https://github.com/keycloak/keycloak-nodejs-admin-client/issues/523
The version number of this repo will follow the version number of @keycloak/keycloak-admin-client.
## Install
```shell
npm i @s3pweb/keycloak-admin-client-cjs
```
## Usage
```ts
import { KeycloakAdminClient } from '@s3pweb/keycloak-admin-client-cjs';
@Injectable()
export class KeycloakService {
private readonly kcAdminClient: KeycloakAdminClient;
constructor(logger: LoggingService) {
this.log = logger.getLogger(KeycloackService.name);
this.kcAdminClient = new KeycloakAdminClient();
}
}
```
## How to release
First, compile and build the project:
```shell
npm i
npm run prepublish
```
To release a new version, you can use the `release` script with the keycloak-admin-client version as an argument:
```shell
npm run release -- --release-as
```
Then push the changes and the new tag to the main branch:
```shell
git push origin main --follow-tags
```