Skip to main content

Vue

Official

Composables and plugins to add authentication to any Vue.js application.

API reference

Every export is fully typed. The signatures and props below come from the package's own reference documentation, so what is listed here is what the installed version ships.

Composables
Components
Providers
hookuseThunderID()

The

useThunderID composable provides access to the ThunderID authentication context in Vue applications. It allows you to retrieve authentication state, user information, and other context values managed by the .

Returns
isSignedIn
boolean

Whether the user is currently signed in

isLoading
boolean

Whether an authentication operation is in progress

user
User \

The authenticated user object, or `null` if not signed in

organization
Organization \

The current active organization

signIn
(...args) => Promise<User \

Initiates the sign-in flow

signOut
(...args) => Promise

Signs the current user out

signUp
(...args) => Promise

Initiates the sign-up flow

getAccessToken
() => Promise

Returns the current access token

getDecodedIdToken
() => Promise

Returns the decoded ID token payload

http
{ request, requestAll }

Authenticated HTTP client (see Accessing Protected APIs)

Example
<script setup>
import { useThunderID } from '@thunderid/vue'

const { isSignedIn, user, signIn, signOut } = useThunderID()
</script>

<template>
  <div>
    <template v-if="isSignedIn">
      <p>Welcome, {{ user?.name }}!</p>
      <button @click="signOut()">Sign Out</button>
    </template>
    <template v-else>
      <button @click="signIn()">Sign In</button>
    </template>
  </div>
</template>

Get started

Provider, session, and a protected route, start to finish.

Connect your application

Getting started / Connect your application / Vue

Open in docs

The quickstart is maintained alongside the rest of the getting-started guides so it stays in step with the platform. This page covers the package itself.

Guides

Task-focused walkthroughs maintained alongside the SDK.

Accessing Protected APIs

Make authenticated HTTP requests from a Vue application using the Browser SDK's built-in HTTP client.

2 min read

Protecting Routes

Secure routes in a Vue application by requiring authentication before rendering protected views.

8 min read
ThunderID LogoThunderID Logo

Product

DocsAPIsSDKs
© Copyright Linux Foundation Europe.For web site terms of use, trademark policy and other project policies please see https://linuxfoundation.eu/en/policies.