Agent Native

clerk-vue-patterns

This skill provides Vue 3 composables and patterns for integrating Clerk authentication, including useAuth, useUser, useClerk, and useOrganization hooks.

by ClerkOfficial publisherNot reviewed

Identity proven by GitHub's verified organisation badge (clerk)

Agents
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode
License
MIT (permissive)
Pin
a02dbd2pinned Oct 9, 2026
Context cost
about 600 tokenswhen the skill loads
GitHub stars
86on clerk/skills
Scripts
2 scripts

What it does

“Vue 3 patterns with Clerk — composables (useAuth, useUser, useClerk, useOrganization), Vue Router guards, Pinia auth store integration. Triggers on: vue clerk, useAuth vue, clerk composables, vue router clerk guard, pinia auth clerk. For Nuxt, use clerk-nuxt-patterns instead.”
The author's description, from SKILL.md

Generated summary from the skill's own text

This skill provides Vue 3 composables and patterns for integrating Clerk authentication, including useAuth, useUser, useClerk, and useOrganization hooks. It covers Vue Router navigation guards and Pinia store integration for managing authentication state in Vue applications using the @clerk/vue SDK v2 or later.

When to use it

  • Building Vue 3 apps with Clerk authentication and user management
  • Protecting Vue Router routes based on authentication status
  • Managing organization switching in multi-tenant Vue applications
  • Storing and syncing Clerk auth state with Pinia

When not to

  • Building Nuxt applications, use clerk-nuxt-patterns instead
  • Setting up Clerk for the first time, use clerk-setup instead

Install

These commands install from the publisher's repository and need no account.

skills CLI

npx skills add clerk/skills --skill clerk-vue-patterns

Installs from the repository's default branch, which may have changed since the commit we checked.

GitHub CLI 2.90 or later

gh skill install clerk/skills clerk-vue-patterns@a02dbd2a933b8929525129a6cb9dcf6ed66d0adf

Installs the commit we checked (a02dbd2).

Copy by hand

Download the folder at a02dbd2 and put it in .claude/skills/clerk-vue-patterns for Claude Code and in .agents/skills/clerk-vue-patterns for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.

Skill folder on GitHub at a02dbd2

Copy for your agent

A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.

Prompt

Install the agent skill "clerk-vue-patterns" by Clerk.

Source, pinned to commit a02dbd2a933b8929525129a6cb9dcf6ed66d0adf:
https://github.com/clerk/skills/tree/a02dbd2a933b8929525129a6cb9dcf6ed66d0adf/skills/clerk-vue-patterns

1. Download that folder at exactly this commit. Do not use the default branch.
2. Copy every file unchanged, keeping the folder structure, into .claude/skills/clerk-vue-patterns/ for Claude Code and .agents/skills/clerk-vue-patterns/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist.
3. Do not edit the files, and do not run any script in the folder unless I ask you to.
4. When you are done, list the files you copied and where you put them.

Listing and checks: https://www.agentnative.dev/skills/clerk/clerk-vue-patterns

SKILL.md at the pin

---
name: clerk-vue-patterns
description: 'Vue 3 patterns with Clerk — composables (useAuth, useUser,
  useClerk, useOrganization), Vue Router guards, Pinia auth store
  integration. Triggers on: vue clerk, useAuth vue, clerk composables,
  vue router clerk guard, pinia auth clerk. For Nuxt, use clerk-nuxt-patterns instead.'
license: MIT
allowed-tools: WebFetch
metadata:
  author: clerk
  version: 1.0.0
---

# Vue Patterns

SDK: `@clerk/vue` v2+ (Vue 3). For Nuxt, use `clerk-nuxt-patterns`.

## What Do You Need?

| Task | Reference |
|------|-----------|
| Composables: useAuth, useUser, useOrganization | references/composables.md |
| Vue Router navigation guards | references/vue-router-guards.md |
| Pinia store with auth state | references/pinia-integration.md |

## Mental Model

Vue uses composables from `@clerk/vue`:

- **`useAuth()`** — reactive `isSignedIn`, `userId`, `signOut`
- **`useUser()`** — reactive `user` object
- **`useClerk()`** — full Clerk instance for advanced operations
- **`useOrganization()`** — reactive `organization`, `membership`

## Setup

### Vue (Plain)

```ts
// main.ts
import { clerkPlugin } from '@clerk/vue'
import { createApp } from 'vue'
import App from './App.vue'

const app = createApp(App)
app.use(clerkPlugin, {
  publishableKey: import.meta.env.VITE_CLERK_PUBLISHABLE_KEY,
})
app.mount('#app')
```

## Composables Usage

```vue
<script setup lang="ts">
import { useAuth, useUser } from '@clerk/vue'

const { isSignedIn, userId, signOut } = useAuth()
const { user } = useUser()
</script>

<template>
  <div v-if="isSignedIn">
    <p>Hello {{ user?.firstName }}</p>
    <button @click="signOut()">Sign Out</button>
  </div>
  <SignInButton v-else />
</template>
```

## Org Switching

```vue
<script setup lang="ts">
import { useOrganizationList } from '@clerk/vue'

const { userMemberships, setActive } = useOrganizationList()
</script>

<template>
  <button
    v-for="mem in userMemberships.data ?? []"
    :key="mem.organization.id"
    @click="setActive({ organization: mem.organization.id })"
  >
    {{ mem.organization.name }}
  </button>
</template>
```

## Common Pitfalls

| Symptom | Cause | Fix |
|---------|-------|-----|
| Composables return `undefined` | Not inside `ClerkProvider` tree | Ensure `app.use(clerkPlugin, { publishableKey })` is called |
| `userId` reactive but not updating | Destructuring loses reactivity | Use `const { userId } = useAuth()` (toRefs-style composable, reactive) |
## Import Map

| What | Import |
|------|--------|
| Composables | `@clerk/vue` |
| Plugin setup | `@clerk/vue` |
| Components | `@clerk/vue` |

## See Also

- `clerk-setup` - Initial Clerk install
- `clerk-custom-ui` - Custom flows & appearance
- `clerk-orgs` - B2B organizations

## Docs

- [Vue SDK](https://clerk.com/docs/vue/getting-started/quickstart)

From clerk/skills at a02dbd2, shown as plain text under its license: MIT (permissive). The license text is in skills/clerk-vue-patterns/SKILL.md.

View SKILL.md on GitHub at a02dbd2

Files

11 files, 12 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.

Skill folder on GitHub at a02dbd2
All 21 skills from Clerk

More from Clerk

  • audit-clerk-skill

    Audits the bundled clerk-cli skill against the Clerk CLI source repository, comparing commands, flags, and agent-mode behavior to detect drift, gaps, and…

    Claude Code · about 1.9K tokens · pinned 6 days ago

  • audit-expo-skill

    Audits the clerk-expo skill against the @clerk/expo SDK source and clerk-docs to detect API drift, missing coverage, and stale claims.

    Claude Code · about 2.2K tokens · pinned 6 days ago

  • clerk

    This skill routes Clerk authentication tasks to specialized sub-skills based on the user's specific need, such as framework setup, CLI operations, custom UI…

    Claude Code, Codex, Cursor +4 · about 1.4K tokens · pinned 6 days ago

  • clerk-android

    This skill implements Clerk authentication in native Android apps written in Kotlin and Jetpack Compose by following the clerk-android SDK patterns and…

    Claude Code, Codex, Cursor +4 · about 2K tokens · pinned 6 days ago

  • clerk-astro-patterns

    This skill teaches the agent to integrate Clerk authentication into Astro applications using middleware, SSR pages, island components, and API routes.

    Contains scripts

    Claude Code, Codex, Cursor +3 · about 850 tokens · pinned 6 days ago

  • clerk-billing

    Clerk Billing enables subscription management in SaaS apps by rendering pricing tables and checkout drawers, configuring plans with feature entitlements, and…

    Claude Code, Codex, Cursor +4 · about 4.9K tokens · pinned 6 days ago

  • remotion-saas

    This skill helps build video generation applications using Remotion, a React framework for programmatic video creation.

    by RemotionOfficial publisher

    Claude Code, Codex, Cursor +3 · about 240 tokens · pinned 6 days ago

  • stitch::code-to-design

    This skill converts existing frontend code (React, Vue, Angular, etc.) into a Stitch Design by extracting HTML, analyzing design systems, and uploading both…

    by GoogleOfficial publisher

    Claude Code, Codex, Cursor +4 · about 760 tokens · pinned 6 days ago

  • stitch::extract-design-md

    Extracts a comprehensive design system document (DESIGN.md) by analyzing frontend source code including component files, stylesheets, Tailwind configs, and…

    by GoogleOfficial publisher

    Claude Code, Codex, Cursor +4 · about 3.3K tokens · pinned 6 days ago

  • create-site

    Guides users through building a complete Power Pages code site using React, Angular, Vue, or Astro, from initial requirements discovery through deployment.

    by MicrosoftOfficial publisher

    Contains scripts

    Claude Code · about 29.1K tokens · pinned 6 days ago

  • portable-text-serialization

    This skill enables rendering Portable Text content across multiple frameworks and output formats using the @portabletext library family.

    by SanityOfficial publisher

    Claude Code, Codex, Cursor +4 · about 940 tokens · pinned 6 days ago

  • mapbox-web-integration-patterns

    Provides production-ready integration patterns for Mapbox GL JS v3.x across React, Vue, Svelte, Angular, Next.js, and vanilla JavaScript.

    by MapboxOfficial publisher

    Claude Code, Codex, Cursor +4 · about 3.1K tokens · pinned 6 days ago

The skills listed here are third-party software, collected from public GitHub repositories as a catalog of recent skills and provided as is. Agent Native does not write or control them and is not responsible for any harm, loss or damage caused by installing or using them. Labels and checks describe what we saw at one commit and are not a guarantee. Read a skill's files before you run it. Terms of use