Authdog

Vue

Authentication for Vue, the Composition way

Add login, sessions, and user data with a provider component and reactive composables that feel native to Vue. Authdog handles the cookies and token refresh so you focus on your app.

One provider
Wrap the tree in AuthdogProvider once and every composable resolves the verified session. No per-component setup.
Reactive auth state
useSession and useUser return reactive refs, so the UI tracks sign-in and sign-out without any manual wiring.
No tokens in the browser
Sessions live in secure, HTTP-only cookies verified on the server, leaving nothing for client code to leak.
Typed composables
Autocomplete for the user, claims, and roles inside every component and composable.

Reactive composables

<script setup lang="ts">
import { useUser } from "@authdog/vue"

const { user, isLoading } = useUser()
</script>

Verify the session on the server

// server/authdog.ts
import { createAuthdogServer } from "@authdog/vue/server"

const authdog = createAuthdogServer({
  publicKey: process.env.AUTHDOG_PUBLIC_KEY!,
})

Composition API native

Everything Vue apps need

A provider, reactive composables, and server helpers that fit the way Vue apps are built.

01

Provider component

Wrap your app in AuthdogProvider once and every component gets access to the verified session. No prop drilling, no manual context.

  • One-time setup
  • No prop drilling
02

Composables

useSession, useUser, useSignIn, useSignUp, and useSignOut give you reactive auth state and actions that feel native to the Composition API.

  • Reactive state
  • Sign-in, sign-up, sign-out
03

Server helpers

createAuthdogServer(), getSessionCookie(), and logoutHandler() handle verification and the session lifecycle on the server side.

  • API routes and SSR
  • Session lifecycle handled
04

Secure by default

Sessions ride secure, HTTP-only cookies and tokens are validated for you. No client-side token juggling to get wrong.

  • HTTP-only cookies
  • Tokens verified server-side
05

Reactive sessions

Auth state is fully reactive, so your templates and computed values update the moment a user signs in or out.

  • Templates stay in sync
  • Computed values update
06

Typed SDK

A fully typed SDK gives you autocomplete for the user, claims, and roles inside your components and composables.

  • User, claims, and roles
  • Autocomplete everywhere
01

Install

Add @authdog/vue and your environment's public key.

02

Add the provider

Wrap your app in AuthdogProvider, once.

03

Use composables

Read the session with useUser() or useSession().

Add auth to your Vue app.

Install the SDK, wrap your app in the provider, and read the session with a composable today. Free to start, with secure defaults built in.