
Product
Introducing Socket Fix for Safe, Automated Dependency Upgrades
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
nuxt-clerk-utils
Advanced tools
Clerk module that builds on top of vue-clerk
This module only works with SSR (server-side rendering) enabled as it uses server API routes. You cannot use this module with nuxt generate
.
nuxt-clerk-utils
# Using pnpm
pnpm add -D nuxt-clerk-utils
# Using yarn
yarn add --dev nuxt-clerk-utils
# Using npm
npm install --save-dev nuxt-clerk-utils
nuxt-clerk-utils
to nuxt.config.ts
export default defineNuxtConfig({
modules: ["nuxt-clerk-utils"],
});
The following environment variables are required in order for this module to function correctly to be defined in your .env
:
NUXT_PUBLIC_CLERK_PUBLISHABLE_KEY=".."
NUXT_CLERK_SECRET_KEY="..."
# Optional: Enable this if you want to handle clerk webhooks
NUXT_CLERK_WEBHOOK_SIGNING_SECRET=".."
NOTE: All of the composables and components are re-exported from vue-clerk. See project documentation for usage
The following helpers are auto-imported in your server/
directory.
// Get the current clerk session if it exists, null otherwise
const clerkSession = await getClerkSession(event);
// Require a clerk session (send back 401 if no `user` session exists)
const clerkSession = await requireClerkSession(event);
To work with webhooks, first create the webhook on the clerk dashboard, and define a handler for it in your app like so:
Note: You must provide the
CLERK_WEBHOOK_SIGNING_SECRET
env (see above)
When defining a webhook in this way, you can assume that the webhook is valid as its signature is automatically verified.
// server/routes/clerk.post.ts
export default defineClerkWebhook('user.created', ({ payload }) => {
console.log('payload', payload)
})
# Install dependencies
pnpm install
# Generate type stubs
pnpm run dev:prepare
# Develop with the playground
pnpm run dev
# Build the playground
pnpm run dev:build
# Run ESLint
pnpm run lint
# Run Vitest
npm run test
npm run test:watch
# Release new version
npm run release
FAQs
Auth utils for clerk
We found that nuxt-clerk-utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Product
We’re excited to announce a powerful new capability in Socket: historical data and enhanced analytics.