
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
@trigo/keycloak-api
Advanced tools
const KeycloakApi = require('@trigo/keycloak-api');
const config = {
authorizationEndpoint: 'https://<keycloak>/auth',
clientId: '<clientId>',
username: '<username>', // admin user
password: '<password>',
};
const api = new KeycloakApi(config);
await api.waitForKeycloak(); // required
Ever function requires a function param called tokenProvider. It should return a access token.
const tokenProvider = async () => {
const res = await api.getToken({
realm: 'master',
grantType: 'password',
clientId: 'admin-cli',
username: '<username>',
password: '<password>',
});
return res.data.access_token;
};
We will refer to this example in the following function calls.
const {statusCode, data, header} = await api.createRealm({ realm: 'sparta', tokenProvider })
Get list of users. Optional query object as key value.
const query = {
username: 'leonidas',
};
const {statusCode, data, header} = await api.getUsers({ realm: 'sparta', query, tokenProvider });
statusCode contains the HTTP status code.
data array of Keycloak Users.
header node-fetch style raw headers
Creates a new user.
const user = {
username: 'leonidas',
};
const {statusCode, data, header} = await api.createUser({ realm: 'sparta', user, tokenProvider });
statusCode contains the HTTP status code.
data the keycloak user object.
header node-fetch style raw headers
Returns all keycloak Groups
const {statusCode, data, header} = await api.getGroups({ realm: 'sparta', tokenProvider });
statusCode contains the HTTP status code.
data array of keycloak groups.
header node-fetch style raw headers
Creates a new user group.
const group = {
name: 'Spartiates',
attributes: {
'size': ['300'],
},
};
const parentGroupId = 300; // Optional
const {statusCode, data, header} = await api.createGroup({ realm: 'sparta', group, parentGroupId, tokenProvider });
statusCode contains the HTTP status code.
data the keycloak group object.
header node-fetch style raw headers
Deletes a user group by groupId
const {statusCode} = await api.deleteGroup({ realm: 'sparta', groupId: 300, tokenProvider });
statusCode contains the HTTP status code.
header node-fetch style raw headers
If group exists it sets the parent otherwise it creates the group as a child
const {statusCode} = await api.makeGroupChildOfGroup({ realm: 'sparta', parentGroupId: '42', group: { id: '43', name: 'child group' }, tokenProvider });
statusCode contains the HTTP status code.
header node-fetch style raw headers
FAQs
Node.js Keycloak Admin API Wrapper
The npm package @trigo/keycloak-api receives a total of 44 weekly downloads. As such, @trigo/keycloak-api popularity was classified as not popular.
We found that @trigo/keycloak-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.