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

@aria-iam/core

v1.0.4

Published

ARIA authentication core — framework-agnostic TypeScript SDK

Readme

@aria-iam/core

🌐 Língua: English · Português

Núcleo TypeScript independente de framework para a plataforma ARIA IAM. Gere tokens, validação de sessão, descodificação de JWT, namespace de cookies e configuração do cliente HTTP — sem dependência de React, Vue ou Angular.

Parte do ARIA SDK.

Instalação

npm install @aria-iam/core

Início rápido

import { createAriaAxios, validateSession, getPkContaFromToken } from "@aria-iam/core";

// 1. Criar o cliente HTTP configurado
const api = createAriaAxios({
  apiUrl:    "https://teu-backend-aria.com",
  loginUrl:  "https://teu-painel-aria.com/login",
  namespace: "priv_2_minha-app",   // opcional — isola cookies por app
});

// 2. Validar a sessão ao carregar a app
const { status, user } = await validateSession(
  "https://teu-backend-aria.com",
  "priv_2_minha-app"
);
// status: "authorized" | "unauthorized" | "unauthenticated" | "checking"

// 3. Ler o ID da conta a partir do JWT no cookie
const pkConta = getPkContaFromToken("priv_2_minha-app");

Referência da API

Sessão

| Função | Descrição | |---|---| | validateSession(apiUrl, namespace?) | POST /auth/validate — devolve { status, user } |

Cookies de token

| Função | Descrição | |---|---| | getToken(namespace?) | Lê o access token | | getRefreshToken(namespace?) | Lê o refresh token | | setTokens(access, refresh, namespace?) | Persiste os dois tokens | | clearTokens(namespace?) | Remove os dois tokens | | getTokensFromUrl(namespace?) | Lê tokens de parâmetros de URL (redirect SSO) | | cleanUrlTokens(namespace?) | Remove os parâmetros de token da URL |

JWT

| Função | Descrição | |---|---| | getPkContaFromToken(namespace?) | Descodifica o JWT e devolve pkConta |

Navegação

| Função | Descrição | |---|---| | redirectToLogin(loginUrl, appId?) | Define o cookie da app e redireciona para o login |

Cliente HTTP

| Função | Descrição | |---|---| | createAriaAxios({ apiUrl, loginUrl, namespace? }) | Devolve uma instância axios com autenticação e refresh automático de token |

Utilitários

| Função | Descrição | |---|---| | buildNamespacedCookieKey(key, namespace?) | Constrói o nome namespaced de um cookie, ex: iam_accessToken__priv_2_tickets |

Namespace de cookies

O namespace isola os cookies de sessão por app quando várias apps correm no mesmo browser.

// Apps privadas — sessões isoladas
getToken("priv_2_tickets")   // lê iam_accessToken__priv_2_tickets
getToken("priv_5_technova")  // lê iam_accessToken__priv_5_technova

// Apps partilhadas — mesma sessão SSO
getToken("part_unitel")      // as duas apps lêem o mesmo cookie

Criar um adaptador para outro framework

import { validateSession, getPkContaFromToken, clearTokens, redirectToLogin } from "@aria-iam/core";

// Exemplo: composable Vue
export function useAriaAuth(apiUrl: string, loginUrl: string, namespace?: string) {
  const status = ref("checking");
  const user   = ref(null);

  onMounted(async () => {
    const result = await validateSession(apiUrl, namespace);
    status.value = result.status;
    user.value   = result.user;
    if (result.status !== "authorized") redirectToLogin(loginUrl);
  });

  return { status, user };
}

Licença

MIT © Sara David Tuma