$clerkStore
The $clerkStore
store provides a convenient way to access the Clerk
object. This provides access to some methods that are not available in other stores.
import { useStore } from '@nanostores/react'
import { $clerkStore } from '@clerk/astro/client'
export default function SignIn() {
const clerk = useStore($clerkStore)
return <button onClick={() => clerk.openSignIn()}>Sign in</button>
}
<script setup>
import { useStore } from '@nanostores/vue'
import { $clerkStore } from '@clerk/astro/client'
const clerk = useStore($clerkStore)
const openSignIn = () => clerk.value.openSignIn()
</script>
<template>
<button @click="openSignIn">Sign in</button>
</template>
<script>
// The $ prefix is reserved in Svelte for its own reactivity system.
// Alias the imports to avoid conflicts.
import { $clerkStore as clerk } from '@clerk/astro/client'
</script>
<button on:click={() => $clerk.openSignIn()}>Sign in</button>
Feedback
Last updated on