• 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

Account Workspace API | React Router Supabase Turbo

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

When within the layout /home/[account] - you have access to data fetched from the account workspace API.

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

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

import { useRouteLoaderData } from 'react-router';
import type { Route as AccountWorkspaceRoute } from '~/types/app/routes/home/account/+types/layout';
export default function Layout() {
const { workspace } = useRouteLoaderData(
'routes/home/account/layout',
) as AccountWorkspaceRoute.ComponentProps['loaderData'];
// use workspace
}
This data is only available in the `/home/[account]` layout.