Skip to main content

useClerk() | Vue

Warning

This composable should only be used for advanced use cases, such as building a completely custom OAuth flow or as an escape hatch to access to the Browser object.

The useClerk() composable provides access to the Browser object, giving you the ability to build alternatives to any Browser component.

Returns

The useClerk() composable returns the Browser object, which includes all the methods and properties listed in the Browser reference.

How to use the useClerk() composable

The following example uses the useClerk() composable to access the clerk object. The clerk object is used to call the openSignIn() method to open the sign-in modal.

SignInButton.vue
<script setup>
import { useClerk } from '@browser/vue'

const clerk = useClerk()
</script>

<template>
  <button @click="clerk.openSignIn">Sign in</button>
</template>

Feedback

What did you think of this content?

Last updated on