• Blog
  • Documentation
  • Courses
  • Changelog
  • AI Starters
  • UI Kit
  • FAQ
  • Supamode
    New
  • Pricing

Launch your next SaaS in record time with Makerkit, a React SaaS Boilerplate for Next.js and Supabase.

Makerkit is a product of Makerkit Pte Ltd (registered in the Republic of Singapore)Company Registration No: 202407149CFor support or inquiries, please contact us

About
  • FAQ
  • Contact
  • Verify your Discord
  • Consultation
  • Open Source
  • Become an Affiliate
Product
  • Documentation
  • Blog
  • Changelog
  • UI Blocks
  • Figma UI Kit
  • AI SaaS Starters
License
  • Activate License
  • Upgrade License
  • Invite Member
Legal
  • Terms of License
    • Account API
    • Team Account API
    • Authentication API
    • User Workspace API
    • Account Workspace API
    • OTP API

User Workspace API | React Router Supabase Turbo

The user workspace API allows you to retrieve all the data related to the current user.

When within the layout /home/(user) - you have access to data fetched from the user workspace API.

The data in this layout has most of the information you need around the currently selected account and the user.

To access the data, you can use the useRouterLoaderData hook.

tsx
import { useRouteLoaderData } from 'react-router';
import type { Route as UserWorkspaceRoute } from '~/types/app/routes/home/user/+types/layout';
export default function Layout() {
const { workspace } = useRouteLoaderData(
'routes/home/user/layout',
) as UserWorkspaceRoute.ComponentProps['loaderData'];
// use workspace
}

This data is only available in the /home/(user) layout.