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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@eqeqo/auth-client

v0.1.0

Published

Lightweight TypeScript client for Eqeqo Auth API login, logout, and password recovery flows.

Readme

Eqeqo Auth API Client

THIS PROJECT DEPENDS DIRECTLY ON HAVING AN EQEQO AUTH API SERVER RUNNING. (HTTPS://GITLAB.COM/NUMANOPE/EQEQO/API-AUTH)

Minimal client library for integrating the Eqeqo Auth API from frontend or Node.js projects. Focuses on interactive client flows (login, logout, password recovery) and provides helpers to attach tokens to other requests.

EQEQO Auth API

Unified client for the centralized authentication and authorization service of the Eqeqo ecosystem, handling token issuance, validation, and access control for all APIs.

⚙️ Setup

Local setup

npm install
npm run build

Tests

1) Have Auth API running and DB with demo content.

2) Define server url on .env

node --test tests/index.js

Notas:

  • Requiere Node 18+ (ideal 20).
  • Puedes copiar .env.example a .env y ajustar AUTH_BASE_URL.
  • No es necesario compilar: el runner transpila src/index.ts al vuelo.

🧩 Covered Endpoints

| Method | Path | Description | | ------ | ---- | ----------- | | POST | /auth/login | Generate a new token for valid user | | POST | /auth/logout | Revoke token (delete from cache) | | GET | /auth/profile | Validate token and return user payload (renews if valid) | | POST | /check-token | Validate token from another API (atomic renewal logic) | | GET | /users | List users | | POST | /users | Create new user | | PUT | /users/{id} | Update user | | DELETE | /users/{id} | Disable or delete user | | GET | /roles | List roles | | POST | /roles | Create role | | GET | /permissions | List permissions | | POST | /permissions | Create permission | | POST | /role-permissions | Assign permission to role | | POST | /service-roles | Assign role to service | | POST | /person-service-roles | Assign role to person in a service |

🔁 Token logic

  • Generated at login (hash(secret + random + timestamp)). NO JWT nor similar.
  • Stored in auth.tokens_cache with payload and modified_at.
  • Renewed automatically if not expired.
  • Removed on logout or user deletion. All requests must include token in header
token: <token>
  • No tokens in URLs.
  • Tokens stored centrally in DB.
  • Short TTL (2–5 min). Cache life, must be defined in one single place in code.
  • Conditional atomic renewal to prevent DB contention.
  • Revocation: delete from table.
  • Logs: minimal (token, endpoint, ts, ip).

🧭 Use case diagram

sequenceDiagram
  autonumber
  actor UI as Frontend (UI)
  participant BACK as Backend (Stock / Sales / Manufacturing)
  participant AUTH as Auth API

  %% 1. Login
  UI->>AUTH: POST /auth/login { user, pass }
  AUTH-->>UI: { token }

  %% 2. Request from UI to Back
  UI->>BACK: GET /{service_id_string}/{user_id_string}\nheaders: token

  %% 3. Cache check + request to Out
  alt Valid local cache (<= 1 min)
    BACK-->>UI: responds using cached payload
  else Expired or missing cache, valid token in Out
    BACK->>AUTH: POST /check-token\n{ token, service_id, user_id }
    AUTH-->>BACK: { valid: true, payload }
    BACK-->>UI: responds and saves payload in cache (1 min)
  else Expired or missing cache, invalid token in Out
    BACK->>AUTH: POST /check-token\n{ token, service_id, user_id }
    AUTH-->>BACK: { valid: false }
    BACK-->>UI: 401 Unauthorized
  end

  %% 4. Writes always validated
  Note over BACK,AUTH: Write operations (POST / PATCH / DELETE)\nalways query Out without using local cache.

  %% 5. Logout
  UI->>AUTH: POST /auth/logout { token }
  AUTH-->>UI: 200 Logged out

Personalización

  • Proporciona tu propia implementación de TokenStorage si prefieres cookies, Secure Storage, etc.
  • Si el runtime no cuenta con fetch (por ejemplo, Node < 18), pasa cualquier implementación compatible (node-fetch, undici, etc.) mediante fetchFn.
  • Ajusta las rutas de recuperación de contraseña sin modificar la API publicando:

MIT © Eqeqo