Skip to content

Plugin

The plugin provides your application the active session and user context to Clerk's composables and other components.

Usage

ts
import { createApp } from 'vue'
import App from './App.vue'
import { clerkPlugin } from 'vue-clerk'

const app = createApp(App)
app.use(clerkPlugin, {
  publishableKey: PUBLISHABLE_KEY
})
app.mount('#app')

Properties

NameTypeDescription
afterMultiSessionSingleSignOutUrlstringThe full URL or path to navigate to after a signing out from a currently active account in a multi-session app.
afterSignOutUrlstringThe full URL or path to navigate to after a successful sign-out.
allowedRedirectOrigins?Array<string |RegExp>Optional array of domains used to validate against the query param of an auth redirect. If no match is made, the redirect is considered unsafe and the default redirect will be used with a warning passed to the console.
appearance?Appearance / undefinedOptional object to style your components. Will only affect Clerk Components and not Account Portal pages.
clerkJSUrl?stringDefine the URL that vue-clerk should hot-load @clerk/clerk-js from.
clerkJSVariant?stringIf your web application only uses Control components, you can set this value to headless and load a minimal ClerkJS bundle for optimal page performance.
clerkJSVersion?stringDefine the npm version for @clerk/clerk-js.
domain?string | ((url: URL) => boolean)This option sets the domain of the satellite application. If your application is a satellite application, this option is required.
isSatellite?boolean | ((url: URL) => boolean)This option defines that the application is a satellite application.
localizationLocalization / undefinedOptional object to localize your components. Will only affect Clerk Components and not Account Portal pages.
publishableKeystringClerk publishable key for your instance. This can be found in your Clerk Dashboard on the API Keys page.
routerPush?(to: string) => Promise<unknown> | voidA function which takes the destination path as an argument and performs a "push" navigation.
routerReplace?(to: string) => Promise<unknown> | voidA function which takes the destination path as an argument and performs a "replace" navigation.
signInFallbackRedirectUrlstringThe fallback URL to redirect to after the user signs in, if there's no redirect_url in the path already. Defaults to /. It's recommended to use the environment variable instead.
signUpFallbackRedirectUrlstringThe fallback URL to redirect to after the user signs up, if there's no redirect_url in the path already. Defaults to /. It's recommended to use the environment variable instead.
signInForceRedirectUrlstringIf provided, this URL will always be redirected to after the user signs in. It's recommended to use the environment variable instead.
signUpForceRedirectUrlstringIf provided, this URL will always be redirected to after the user signs up. It's recommended to use the environment variable instead.
signInUrlstringThis url will be used for any redirects that might happen and needs to point to your primary application. This option is optional for production instances and required for development instances. It's recommended to use the environment variable instead.
signUpUrlstringThis URL will be used for any redirects that might happen and needs to point to your primary application on the client-side. This option is optional for production instances and required for development instances. It's recommended to use the environment variable instead.
supportEmail?stringOptional support email for display in authentication screens. Will only affect Clerk Components and not Account Portal pages.
telemetryfalse | { disabled?: boolean; debug?: boolean }Controls whether or not Clerk will collect telemetry data.

Released under the MIT License.