
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
@authon/vue
Advanced tools
English | 한국어
Drop-in Vue 3 authentication with composables and components — self-hosted Clerk alternative, Auth0 alternative
Before installing the SDK, create an Authon project and get your API keys:
Create a project at Authon Dashboard
Get your API keys from Project Settings → API Keys
pk_live_... or pk_test_...) — safe to use in client-side codesk_live_... or sk_test_...) — server-side only, never expose to clientsConfigure OAuth providers (optional) in Project Settings → OAuth
https://api.authon.dev/v1/auth/oauth/redirectTest vs Live keys: Use
pk_test_...during development. Switch topk_live_...before deploying to production. Test keys use a sandbox environment with no rate limits.
npm install @authon/vue
// src/main.ts
import { createApp } from 'vue';
import { createAuthon } from '@authon/vue';
import App from './App.vue';
const app = createApp(App);
app.use(createAuthon({
publishableKey: 'pk_live_YOUR_PUBLISHABLE_KEY',
config: { apiUrl: 'https://your-authon-server.com' },
}));
app.mount('#app');
<!-- src/App.vue -->
<script setup lang="ts">
import { useAuthon, useUser, AuthonSignedIn, AuthonSignedOut, AuthonUserButton } from '@authon/vue';
const { openSignIn, signOut } = useAuthon();
const { user } = useUser();
</script>
<template>
<AuthonSignedOut>
<button @click="openSignIn()">Sign In</button>
</AuthonSignedOut>
<AuthonSignedIn>
<p>Welcome, {{ user?.email }}</p>
<AuthonUserButton />
<button @click="signOut()">Sign Out</button>
</AuthonSignedIn>
</template>
<script setup lang="ts">
import { useAuthon } from '@authon/vue';
const { client } = useAuthon();
</script>
<template>
<button @click="client?.signInWithOAuth('google')">Sign in with Google</button>
</template>
// src/router/index.ts
import { createRouter, createWebHistory } from 'vue-router';
const router = createRouter({
history: createWebHistory(),
routes: [
{ path: '/', component: () => import('../views/Home.vue') },
{ path: '/dashboard', component: () => import('../views/Dashboard.vue'), meta: { requiresAuth: true } },
{ path: '/sign-in', component: () => import('../views/SignIn.vue') },
],
});
router.beforeEach((to, _from, next) => {
if (to.meta.requiresAuth) {
const authon = router.app?.config.globalProperties.$authon;
if (!authon?.isSignedIn) return next({ path: '/sign-in', query: { redirect: to.fullPath } });
}
next();
});
export default router;
<script setup lang="ts">
import { useUser } from '@authon/vue';
const { user, isLoading } = useUser();
</script>
<template>
<p v-if="isLoading">Loading...</p>
<div v-else-if="user">
<p>Email: {{ user.email }}</p>
<p>Name: {{ user.displayName }}</p>
</div>
<p v-else>Not signed in</p>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { useAuthon } from '@authon/vue';
const { client } = useAuthon();
const email = ref('');
const password = ref('');
async function handleSignIn() {
await client?.signInWithEmail(email.value, password.value);
}
</script>
<template>
<form @submit.prevent="handleSignIn">
<input v-model="email" type="email" placeholder="Email" />
<input v-model="password" type="password" placeholder="Password" />
<button type="submit">Sign In</button>
</form>
</template>
<script setup lang="ts">
import { useAuthon } from '@authon/vue';
const { signOut } = useAuthon();
</script>
<template>
<button @click="signOut()">Sign Out</button>
</template>
| Variable | Required | Description |
|---|---|---|
VITE_AUTHON_API_URL | Yes | Your Authon server URL |
VITE_AUTHON_PUBLISHABLE_KEY | Yes | Project publishable key |
createAuthon({ publishableKey: string, config?: AuthonConfig })
| Composable | Returns |
|---|---|
useAuthon() | { isSignedIn, isLoading, user, client, signOut, openSignIn, openSignUp, getToken } |
useUser() | { user: ComputedRef, isLoading: ComputedRef } |
useAuthonWeb3() | Web3 wallet auth methods |
useAuthonPasswordless() | Magic link and OTP methods |
useAuthonPasskeys() | Passkey registration and auth |
| Component | Description |
|---|---|
<AuthonSignIn> | Sign-in form (mode="popup" or "embedded") |
<AuthonSignUp> | Sign-up form |
<AuthonUserButton> | Avatar dropdown with sign-out |
<AuthonSignedIn> | Slot rendered only when signed in |
<AuthonSignedOut> | Slot rendered only when signed out |
<AuthonSocialButtons> | All enabled OAuth provider buttons |
| Feature | Authon | Clerk | Auth.js |
|---|---|---|---|
| Self-hosted | Yes | No | Partial |
| Pricing | Free | $25/mo+ | Free |
| OAuth providers | 10+ | 20+ | 80+ |
| ShadowDOM modal | Yes | No | No |
| MFA/Passkeys | Yes | Yes | Plugin |
| Web3 auth | Yes | No | No |
MIT
FAQs
Authon Vue 3 SDK — plugin, composables, and components
The npm package @authon/vue receives a total of 9 weekly downloads. As such, @authon/vue popularity was classified as not popular.
We found that @authon/vue demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.