Skip to content

v0.6.0

Compare
Choose a tag to compare
@wobsoriano wobsoriano released this 31 Aug 21:46
· 246 commits to main since this release

Minor changes

  • 6c77ccb: Introduce Nuxt module

    Usage:

    export default defineNuxtConfig({
      modules: ["vue-clerk/nuxt"],
    });
    <script setup>
      const { data: user } = await useCurrentUser()
    </script>
    
    <template>
      <SignedIn>
        <h1>Hello, {{ user?.fullName }}</h1>
        <UserButton />
      </SignedIn>
      <SignedOut>
        <SignInButton mode="modal" />
      </SignedOut>
    </template>
    // server/api/me.ts
    import { clerkClient, getAuth } from '#clerk'
    
    export default eventHandler((event) => {
      const { userId } = getAuth(event);
    
      if (!userId) {
        setResponseStatus(event, 403);
        return;
      }
    
      return clerkClient(event).users.getUser(userId);
    });