updateClerkOptions()
The updateClerkOptions() function is used to update Clerk's options at runtime. It can be called at any time after Clerk has been initialized. The @clerk/nuxt module auto-imports updateClerkOptions(), so you don't need to import it yourself.
Usage
The following example changes the language of Clerk's components when the user selects a different language. It uses @clerk/localizations to pass the selected language to the localization option.
<script setup lang="ts">
import { enUS, esES, frFR } from '@clerk/localizations'
const localizations = {
'en-US': enUS,
'es-ES': esES,
'fr-FR': frFR,
}
const locale = ref<keyof typeof localizations>('en-US')
watch(locale, (newLocale) => {
updateClerkOptions({
localization: localizations[newLocale],
})
})
</script>
<template>
<select v-model="locale">
<option value="en-US">English</option>
<option value="es-ES">Español</option>
<option value="fr-FR">Français</option>
</select>
</template>- Name
appearance?- Type
Appearance | undefined- Description
An object to style your components. Will only affect Clerk components and not Account Portal pages.
- Name
localization?- Type
Localization | undefined- Description
An object to localize your components. Will only affect Clerk components and not Account Portal pages.
Feedback
Last updated on