Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reactivily using window.Clerk client-side #58

Open
svjaime opened this issue May 7, 2024 · 1 comment
Open

Reactivily using window.Clerk client-side #58

svjaime opened this issue May 7, 2024 · 1 comment

Comments

@svjaime
Copy link

svjaime commented May 7, 2024

How can I achieve reactivity with window.Clerk ?

e.g.: I expected that $: console.log(window.Clerk?.organization) to log everytime the user changes organization in the UI, but that doesn't happen. Is there any other way to access clerk's data?

@wobsoriano
Copy link

wobsoriano commented Jul 29, 2024

Wait for this PR to be merged, and you will be able to do it like this:

<script lang="ts">
	import { useClerkContext } from 'clerk-sveltekit/client'

        const { clerk, organization } = useClerkContext()

	$: console.log($clerk?.organization)
        $: console.log($organization)
</script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants