+ Loading...
+ Sign in to access this page
+ Hello, {{ user.firstName }}!
+
+```
+
+## Server-side
+
+### `clerkClient()`
+
+The `clerkClient()` helper returns an instance of the [JavaScript Backend SDK](/docs/references/backend/overview).
+
+In the following example, the [`auth`](/docs/references/nuxt/overview#auth-object) object is used to get the `userId` to check if the user is signed in. The `clerkClient()` helper retrieves the full [`User`](/docs/references/javascript/user/user) object.
+
+```ts {{ filename: 'server/api/auth/index.ts' }}
+import { clerkClient } from '@clerk/nuxt/server'
+
+export default defineEventHandler(async (event) => {
+ const { userId } = event.context.auth
+
+ // Check if the user is signed in
+ if (!userId) {
+ throw createError({
+ statusCode: 401,
+ statusMessage: 'Unauthorized: No user ID provided',
+ })
+ }
+
+ // Retrieve the user data
+ const user = await clerkClient(event).users.getUser(userId)
+ return user
+})
+```