npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@ordus/auth

v0.0.1-alpha-20

Published

> Biblioteca Node.js para integração com **Keycloak 26** (não testada em outras versões).

Readme

🛡️ Ordus Auth

Biblioteca Node.js para integração com Keycloak 26 (não testada em outras versões).


🚀 Funcionalidades

Esta biblioteca fornece uma camada de abstração para interações com o Keycloak, oferecendo funcionalidades como:

  • 🔐 Autenticação de usuários
  • 🚪 Revogação de sessão (Logout)
  • 🔑 Reset de senha
  • 👤 Criação de usuários
  • 📄 Listagem de usuários
  • 🔍 Busca de usuário por e-mail
  • ✏️ Atualização de dados do usuário
  • 🏷️ Atribuição de grupos a usuários
  • Remoção de grupos de usuários
  • 📜 Listagem de grupos do sistema

⚙️ Pré-requisitos

  • ✅ Keycloak na versão 26 (ou compatível).
  • ✅ Node.js com suporte a ES2020+.
  • ✅ Ambiente configurado com as credenciais de acesso ao Keycloak.

🔑 Configuração

Adicione as seguintes variáveis de ambiente no seu .env ou no ambiente de execução:

KEYCLOAK_CLIENT_ID=client_id
KEYCLOAK_CLIENT_SECRET=client_secret
KEYCLOAK_REALM=realm
KEYCLOAK_URL=http://keycloak-url

| Variável | Descrição | | ------------------------ | -------------------------------------------------------------------------- | | KEYCLOAK_CLIENT_ID | ID do cliente configurado no Keycloak | | KEYCLOAK_CLIENT_SECRET | Secret do cliente | | KEYCLOAK_REALM | Nome do Realm | | KEYCLOAK_URL | URL base do Keycloak (ex.: http://localhost:8080) |


Configuração do Keycloak

Como configurar o Keycloak

🧠 Instalação

Instale a biblioteca via NPM ou PNPM:

npm install @ordus/auth
# ou
pnpm add @ordus/auth

🛠️ Exemplos de uso

🔐 Autenticação

import { SignInUsecase } from '@ordus/auth'

const auth = await new SignInUsecase().execute({
  username: '[email protected]',
  password: '1233456',
})

console.log(auth.data.access_token)

👤 Criar usuário

import { CreateUserUsecase } from '@ordus/auth'

await new CreateUserUsecase().execute({
  username: 'john.doe',
  email: '[email protected]',
  firstName: 'John',
  lastName: 'Doe',
  enabled: true,
  password: '1234567',
  isTemporaryPassword: false,
})

🏷️ Atribuir grupo ao usuário

import { AssignGroupsToUserUsecase } from '@ordus/auth'

await new AssignGroupsToUserUsecase().execute({
  id: 'user-id',
  groups: ['group-id-1', 'group-id-2'],
})

📜 Listar grupos

import { ListGroupsUsecase } from '@ordus/auth'

const groups = await new ListGroupsUsecase().execute()

console.log(groups)

🚧 Observações

  • Esta biblioteca foi desenvolvida e testada com o Keycloak 26.
  • Outras versões podem ou não ser compatíveis. Testes são recomendados antes de uso em produção.
  • Sugestões, melhorias ou issues são bem-vindas!

🤝 Contribuição

  1. Faça um fork do projeto.
  2. Crie uma branch para sua feature: git checkout -b feature/sua-feature.
  3. Commit suas alterações: git commit -m 'feat: sua feature'.
  4. Push para sua branch: git push origin feature/sua-feature.
  5. Abra um Pull Request.

📝 Licença

Este projeto está licenciado sob a licença MIT.