Skip to content

Authenticated

The Authenticated component is used to render content only when a user is authenticated. It also provides a signOut function that can be used to sign the user out.

This component must be a child of the SupabaseApp component to work.

Props

This component does not accept any props.

Slots

PropertyDescription
sessionThe user session data.
authThe Supabase authentication client.
errorThe authentication error, if any.
signOutA function that signs out the user.

Usage

<script lang="ts">
import { Authenticated } from 'supasveltekit';
</script>
<Authenticated let:session let:signOut>
<h1>Only authenticated users can see this</h1>
<button on:click={() => signOut()}>Sign Out</button>
</Authenticated>