@glinr/theauth-vue
@glinr/theauth-vue
npm · Source · Docs · All packages
Vue plugin and composables for theAuth authentication.
Part of theAuth, open-source auth for AI agents and humans. Docs: docs.theauth.dev.
Install
npm install @glinr/theauth-vue
Usage
Register the plugin in your Vue app, then use composables in any component.
// main.ts
import { createApp } from 'vue';
import { createTheAuthPlugin } from '@glinr/theauth-vue';
import App from './App.vue';
const app = createApp(App);
app.use(createTheAuthPlugin({
apiUrl: 'https://auth.yourapp.com',
tenantId: 'your-tenant-id',
}));
app.mount('#app');
<script setup lang="ts">
import { useSession, useUser, useSignIn, useSignOut } from '@glinr/theauth-vue';
const { session, isLoading } = useSession();
const { user } = useUser();
const { signIn } = useSignIn();
const { signOut } = useSignOut();
</script>
<template>
<div v-if="!isLoading">
<p v-if="user">Welcome, {{ user.email }}</p>
<button v-if="session" @click="signOut">Sign out</button>
</div>
</template>
Exports
createTheAuthPlugin: Vue plugin factoryuseSession: current session and loading stateuseUser: authenticated user objectuseSignIn: sign-in composableuseSignOut: sign-out composableuseSignUp: sign-up composableuseAgents: manage AI agents for the current user
Docs
Community
Questions and help in the #theauth forum on the GLINR Discord.
License
MIT
Related Packages
@grantry/vue
Experimental: authentication, accounts and billing state for Vue 3 applications,...
373
Version History
| Version | Released | License |
|---|---|---|
| 0.3.0 | MIT | |
| 0.2.0 | MIT | |
| 0.1.0 | MIT |