v0.6.0
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); });