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/vue

v1.0.2

Published

ARIA authentication Vue 3 adapter — AriaIamPlugin, useAuth, usePermissions and ProtectedRoute

Readme

@aria-iam/vue

🌐 Língua: English · Português

Adaptador Vue 3 para a plataforma ARIA IAM. Disponibiliza um plugin, composables, um componente e uma directiva que ligam a tua app Vue 3 ao sistema de autenticação e permissões ARIA.

Parte do ARIA SDK.

Instalação

npm install @aria-iam/core @aria-iam/vue

Início rápido

// main.ts
import { createApp } from "vue";
import { AriaIamPlugin } from "@aria-iam/vue";
import App from "./App.vue";

createApp(App)
  .use(AriaIamPlugin, {
    apiUrl:         "https://teu-backend-aria.com",
    loginUrl:       "https://teu-painel-aria.com/login",
    appId:          "id-da-tua-app",
    tokenNamespace: "priv_2_minha-app",
  })
  .mount("#app");
<!-- App.vue -->
<script setup lang="ts">
import { ProtectedRoute } from "@aria-iam/vue";
</script>

<template>
  <ProtectedRoute>
    <RouterView />
  </ProtectedRoute>
</template>

API

AriaIamPlugin

Plugin Vue — chama app.use(AriaIamPlugin, config) uma vez em main.ts.

app.use(AriaIamPlugin, {
  apiUrl:         "https://teu-backend-aria.com",        // obrigatório
  loginUrl:       "https://teu-painel-aria.com/login",   // obrigatório
  appId:          "id-da-tua-app",                       // opcional
  tokenNamespace: "priv_2_minha-app",                    // opcional
})

useAuth()

Composable para estado de sessão reactivo.

import { useAuth } from "@aria-iam/vue";

const { status, user, logout } = useAuth();
// status: Ref<"checking" | "authorized" | "unauthorized" | "unauthenticated">

usePermissions()

Composable para carregar e verificar permissões do utilizador.

import { usePermissions } from "@aria-iam/vue";

const { allowed, loading, can, load } = usePermissions();

onMounted(() => load(2, (pkConta, appId) => minhaApi.buscarPermissoes(pkConta, appId)));

can(14); // boolean

useCan(pkFuncionalidade)

Composable de atalho para verificar uma permissão específica. Devolve ComputedRef<boolean> reactivo.

import { useCan } from "@aria-iam/vue";

const podeEditar = useCan(14);
<button v-if="podeEditar">Editar</button>

<ProtectedRoute>

Componente que redireciona para o login se a sessão não for válida.

<ProtectedRoute>
  <RouterView />
</ProtectedRoute>

Directiva v-can

Verificação de permissão ao nível do elemento — esconde o elemento se o utilizador não tiver a permissão.

// main.ts
import { vCan } from "@aria-iam/vue";
app.directive("can", vCan);
<button v-can="14">Editar</button>

Namespace de sessão (SSO / isolamento)

// Isolado — cada app privada tem os seus próprios tokens
app.use(AriaIamPlugin, { ..., tokenNamespace: "priv_2_tickets" })
app.use(AriaIamPlugin, { ..., tokenNamespace: "priv_5_technova" })

// Partilhado — estas duas apps partilham a mesma sessão SSO
app.use(AriaIamPlugin, { ..., tokenNamespace: "part_unitel" })

Licença

MIT © Sara David Tuma