Learn how to access and manage the user authentication state on the client-side in your Svelte or SvelteKit application.
Before we can begin to access authentication state, the Corbado.load()
call has to resolve.
Find more here.
If you want to access user state once, you can simply call Corbado.sessionToken
,
Corbado.user
or Corbado.isAuthenticated
to get the current user state.
If you want to synchronize user state to your own state, you can subscribe to the authStateChanges
and userChanges
observables.
You can log out the user by calling Corbado.logout
.
Access user information on the server-side of your application.
Learn how to access and manage the user authentication state on the client-side in your Svelte or SvelteKit application.
Before we can begin to access authentication state, the Corbado.load()
call has to resolve.
Find more here.
If you want to access user state once, you can simply call Corbado.sessionToken
,
Corbado.user
or Corbado.isAuthenticated
to get the current user state.
If you want to synchronize user state to your own state, you can subscribe to the authStateChanges
and userChanges
observables.
You can log out the user by calling Corbado.logout
.
Access user information on the server-side of your application.