@authms/vue

AuthMS Vue SDK — createAuthms plugin, useAuthms composable, vAuth directive, and authmsGuard router guard
826
Install
npm install @authms/vue
Latest Version:0.2.1
Vue:3
License:MIT
Last Updated:Jun 30, 2026
Links: npm
Maintainer: boyce6280

@authms/vue

AuthMS Vue SDK — createAuthms() plugin, useAuthms() composable, v-auth directive, and authmsGuard router guard.

What's Inside

  • createAuthms(config) — Vue plugin that creates and initializes an AuthMS instance, injects via provide
  • useAuthms() — composable returning { authms, user, isLoading, isAuthenticated, login, logout }
  • vAuth — directive for conditional rendering based on auth state
  • authmsGuard — beforeEach navigation guard for vue-router

Install

npm install @authms/core @authms/vue

Quick Start

// main.ts
import { createApp } from 'vue';
import { createAuthms } from '@authms/vue';
import App from './App.vue';

const app = createApp(App);
app.use(createAuthms({
  appId: 'my-app',
  issuer: 'https://auth.iam.tianv.com',
}));
app.mount('#app');
<!-- Dashboard.vue -->
<script setup lang="ts">
import { useAuthms } from '@authms/vue';

const { user, isLoading, login, logout } = useAuthms();
</script>

<template>
  <div v-if="isLoading">Loading...</div>
  <div v-else-if="!user">
    <button @click="login({ email: 'a@b.com', password: 'x' })">Login</button>
  </div>
  <div v-else>
    <h1>Welcome, {{ user.displayName }}</h1>
    <button @click="logout">Logout</button>
  </div>
</template>

Project Setup

Copy examples/vue-authms.ts to src/authms.ts, edit appId and issuer. All your components import from ./authms.

See the root SDK README for full documentation.

Related Packages

@idenzy/vue

Vue bindings for Idenzy: a plugin and useSession, useUser and useIdenzy.

163 0
@resourge/vue3-use-authentication

Vue 3 use Authentication/Permissions hook

3,730 1
@idenzy/nuxt

The Nuxt module for Idenzy: the Vue bindings, plus a server render seeded from t...

183 0
vuejs-jwt

Lightweight JWT library for Vue.js 2

26,880 28
@pelygo/auth

Centralized authentication package for VCOMSUITE applications

5,138

Version History

Version Released Vue License
0.2.1 >=3.0.0 MIT
0.2.0 >=3.0.0 MIT
0.1.1 >=3.0.0 MIT
0.1.0 >=3.0.0 MIT