← Back to Skills Marketplace
auth0

Auth0 Vue

by Auth0 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
76
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install auth0-vue
Description
Use when adding authentication to Vue.js 3 applications (login, logout, user sessions, protected routes) - integrates @auth0/auth0-vue SDK for SPAs with Vite...
README (SKILL.md)

Auth0 Vue.js Integration

Add authentication to Vue.js 3 single-page applications using @auth0/auth0-vue.


Prerequisites

  • Vue 3+ application (Vite or Vue CLI)
  • Auth0 account and application configured
  • If you don't have Auth0 set up yet, use the auth0-quickstart skill first

When NOT to Use

  • Server-side rendered Vue apps - See Auth0 Nuxt.js guide for SSR patterns
  • Vue 2 applications - This SDK requires Vue 3+, use legacy @auth0/auth0-spa-js wrapper
  • Embedded login - This SDK uses Auth0 Universal Login (redirect-based)
  • Backend API authentication - Use express-openid-connect or JWT validation instead

Quick Start Workflow

1. Install SDK

npm install @auth0/auth0-vue

2. Configure Environment

For automated setup with Auth0 CLI, see Setup Guide for complete scripts.

For manual setup:

Create .env file:

VITE_AUTH0_DOMAIN=your-tenant.auth0.com
VITE_AUTH0_CLIENT_ID=your-client-id

3. Configure Auth0 Plugin

Update src/main.ts:

import { createApp } from 'vue';
import { createAuth0 } from '@auth0/auth0-vue';
import App from './App.vue';

const app = createApp(App);

app.use(
  createAuth0({
    domain: import.meta.env.VITE_AUTH0_DOMAIN,
    clientId: import.meta.env.VITE_AUTH0_CLIENT_ID,
    authorizationParams: {
      redirect_uri: window.location.origin
    }
  })
);

app.mount('#app');

4. Add Authentication UI

Create a login component:

\x3Cscript setup lang="ts">
import { useAuth0 } from '@auth0/auth0-vue';

const { loginWithRedirect, logout, isAuthenticated, user, isLoading } = useAuth0();
\x3C/script>

\x3Ctemplate>
  \x3Cdiv>
    \x3Cdiv v-if="isLoading">Loading...\x3C/div>

    \x3Cdiv v-else-if="isAuthenticated">
      \x3Cimg :src="user?.picture" :alt="user?.name" />
      \x3Cspan>Welcome, {{ user?.name }}\x3C/span>
      \x3Cbutton @click="logout({ logoutParams: { returnTo: window.location.origin }})">
        Logout
      \x3C/button>
    \x3C/div>

    \x3Cbutton v-else @click="loginWithRedirect()">
      Login
    \x3C/button>
  \x3C/div>
\x3C/template>

5. Test Authentication

Start your dev server and test the login flow:

npm run dev

Detailed Documentation

  • Setup Guide - Automated setup scripts (Bash/PowerShell), CLI commands, manual configuration
  • Integration Guide - Protected routes, API calls, error handling, composables
  • API Reference - Complete SDK API, configuration options, composables reference, testing strategies

Common Mistakes

Mistake Fix
Forgot to add redirect URI in Auth0 Dashboard Add your application URL (e.g., http://localhost:3000, https://app.example.com) to Allowed Callback URLs in Auth0 Dashboard
Using wrong env var prefix Vite requires VITE_ prefix, Vue CLI uses VUE_APP_
Not handling loading state Always check isLoading before rendering auth-dependent UI
Storing tokens in localStorage Never manually store tokens - SDK handles secure storage automatically
Missing createAuth0 plugin registration Must call app.use(createAuth0({...})) before mounting app
Accessing auth before plugin loads Wrap auth-dependent code in v-if="!isLoading"

Related Skills

  • auth0-quickstart - Basic Auth0 setup
  • auth0-migration - Migrate from another auth provider
  • auth0-mfa - Add Multi-Factor Authentication

Quick Reference

Core Composables:

  • useAuth0() - Main authentication composable
  • isAuthenticated - Reactive check if user is logged in
  • user - Reactive user profile information
  • loginWithRedirect() - Initiate login
  • logout() - Log out user
  • getAccessTokenSilently() - Get access token for API calls

Common Use Cases:


References

Usage Guidance
This skill is coherent with adding Auth0 to Vue 3 apps, but review and run setup steps manually rather than blindly. Specific points to consider before installing/running scripts: - The automated setup may install the Auth0 CLI (brew/scoop or a curl | sh installer). Inspect the install script (https://raw.githubusercontent.com/auth0/auth0-cli/main/install.sh) before executing. Prefer package-manager installs you trust. - The setup scripts call auth0 login and may create/modify an Auth0 application; that will open a browser and store CLI session tokens locally — this is expected but be aware it grants the CLI access to your Auth0 tenant. - The scripts append client configuration to your project .env. Confirm the prompt before writing to an existing .env to avoid inadvertently exposing unrelated secrets. - The client ID and domain are public (not secrets), but you should never place client secrets in client-side .env files. If you prefer a lower-risk path: skip the automated scripts and manually create an Auth0 SPA application in the Auth0 Dashboard and add VITE_AUTH0_DOMAIN and VITE_AUTH0_CLIENT_ID to your project .env as shown in the docs.
Capability Analysis
Type: OpenClaw Skill Name: auth0-vue Version: 1.0.0 The skill bundle provides a legitimate and well-documented integration for Auth0 authentication in Vue.js 3 applications. It includes comprehensive guides and automated setup scripts in 'references/setup.md' that use the official Auth0 CLI to configure the environment. While the scripts perform potentially risky actions such as installing software via 'curl | sh' and modifying '.env' files, these are standard practices for the stated purpose and are accompanied by explicit instructions for the AI agent to prioritize user consent and protect sensitive data from being read into the LLM context.
Capability Tags
requires-oauth-tokenrequires-sensitive-credentials
Capability Assessment
Purpose & Capability
Name/description match the instructions: the SKILL.md and reference docs exclusively describe integrating @auth0/auth0-vue into Vue 3 apps, protecting routes, and calling APIs. The guidance to create VITE_AUTH0_DOMAIN and VITE_AUTH0_CLIENT_ID (client ID + domain) is consistent with the purpose; no unrelated services, binaries, or credentials are requested.
Instruction Scope
Runtime instructions stay within scope: they tell the developer to install the SDK, configure the plugin, create .env entries, and optionally use the Auth0 CLI to create/manage an application. The setup docs explicitly warn not to read .env contents and require user confirmation before writing to .env, which limits dangerous scope creep.
Install Mechanism
The skill is instruction-only (no install spec), which is low risk. The automated setup scripts, however, recommend installing the Auth0 CLI via typical package managers (brew, scoop) and include a curl -sSfL https://raw.githubusercontent.com/... | sh pattern for Linux — a common convenience but higher-risk pattern because it downloads and executes a script. The URL is GitHub raw (official project) rather than a personal server, which mitigates but does not eliminate risk. Review the install script before executing.
Credentials
The skill does not request platform-level secrets or list required env vars in its metadata. It instructs creating VITE_ variables in a project .env (public client ID and domain). The automated setup prompts the user to run auth0 login (which will create local CLI session tokens) and writes public client info into .env only after explicit confirmation — behavior proportionate to the described purpose. Be aware that auth0 CLI login will store credentials/tokens locally as part of normal CLI behavior.
Persistence & Privilege
The skill does not request persistent agent-level privileges (always: false) and contains no code that modifies other skills or global agent config. The only persistent changes described are appending to the project's .env and optional installation of the Auth0 CLI via system package managers — both are expected for a developer-facing setup flow and are performed only with user action/consent.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install auth0-vue
  3. After installation, invoke the skill by name or use /auth0-vue
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release: Auth0 authentication integration for Vue.js 3 applications. - Provides quick start guide for installing and configuring @auth0/auth0-vue SDK. - Includes setup steps, authentication UI example, and troubleshooting section. - Links to detailed documentation for setup, integration, and API references. - Outlines common mistakes and solutions for smoother implementation.
Metadata
Slug auth0-vue
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Auth0 Vue?

Use when adding authentication to Vue.js 3 applications (login, logout, user sessions, protected routes) - integrates @auth0/auth0-vue SDK for SPAs with Vite... It is an AI Agent Skill for Claude Code / OpenClaw, with 76 downloads so far.

How do I install Auth0 Vue?

Run "/install auth0-vue" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Auth0 Vue free?

Yes, Auth0 Vue is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Auth0 Vue support?

Auth0 Vue is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Auth0 Vue?

It is built and maintained by Auth0 (@auth0); the current version is v1.0.0.

💬 Comments