Build multi-tenant Next.js applications with GitHat. Organization switching, role-based access, team invitations, and scoped API tokens.
Build SaaS apps with Next.js and GitHat. Every user can create and join multiple organizations. The OrgSwitcher component lets users switch between orgs seamlessly.
The OrgSwitcher component lists all orgs the user belongs to. Clicking an org calls switchOrg() which gets new tokens scoped to that org. The entire app context updates instantly.
Use useAuth() to access the current user's org role. Conditionally render admin panels, invite forms, and settings pages based on whether the user is an owner, admin, or member.
npm install @githat/nextjs
// Dashboard header with org switching
'use client';
import { useAuth, OrgSwitcher, UserButton } from '@githat/nextjs';
export function DashboardHeader() {
const { user, org } = useAuth();
return (
<header>
<span>{org?.name}</span>
<OrgSwitcher />
<UserButton />
{org?.role === 'owner' && <a href="/settings/billing">Billing</a>}
</header>
);
}
Try GitHat free
Ship authenticated apps in minutes, not weeks.