Svelte
Server-side Authentication State
Learn how to access and manage the user authentication state on the server-side in your SvelteKit application.
This guide is only applicable to SvelteKit applications, as they can contain code that runs on the server-side.
Prerequisites
Install the Corbado Node.js SDK:
Generate an API secret in the developer panel to allow the SDK to access the Corbado BackendAPI.
Example
To gain access to authentication state on the server-side we utilize the Corbdo Node.js SDK.
We might use it in a server-side load function to verify the user is authenticated and retrieve some data in this case:
routes/profile/+page.server.ts
Find more info on the Corbdo Node.js SDK in the backend integration section.
Was this page helpful?