PrivyStack
All-in-one provider that sets up authentication and account management. Wrap your app with this once.
A React component library that handles authentication, payments, and account management so you can focus on building your application.
npm install @varity-labs/ui-kit @varity-labs/sdkimport { PrivyStack, PrivyLoginButton } from '@varity-labs/ui-kit';
function App() { return ( <PrivyStack> <PrivyLoginButton /> <YourApp /> </PrivyStack> );}That’s it. Users can now sign in with email or social accounts.
PrivyStack
All-in-one provider that sets up authentication and account management. Wrap your app with this once.
PrivyLoginButton
Pre-built login button that opens the authentication modal. Supports email, Google, Twitter, Discord, and more.
PaymentWidget
Payment widget for in-app purchases and upgrades (post-beta).
PrivyProtectedRoute
Wrapper that shows content only to authenticated users. Shows login prompt otherwise.
import { usePrivy } from '@varity-labs/ui-kit';
function Dashboard() { const { authenticated, user, logout } = usePrivy();
if (!authenticated) { return <PrivyLoginButton />; }
return ( <div> <p>Welcome, {user?.email?.address || 'User'}</p> <button onClick={logout}>Sign Out</button> </div> );}When a user signs in with email or social login:
| Behind the Scenes | What User Sees |
|---|---|
| Account created | ”Signed in successfully” |
| Account linked to profile | User profile with email |
| Ready for operations | Can use your app immediately |
Users never see technical details or extra prompts unless you choose to show them.
| Export | Description |
|---|---|
PrivyStack | All-in-one provider (recommended) |
VarityPrivyProvider | Authentication provider with Wagmi |
VarityDashboardProvider | Dashboard-specific provider setup |
| Export | Description |
|---|---|
PrivyLoginButton | Login button with modal |
PrivyUserProfile | Display user info with logout |
PrivyProtectedRoute | Auth-gated content wrapper |
PrivyReadyGate | Loading state during initialization |
PaymentWidget | In-app payment widget (post-beta) |
PaymentGate | Subscription/tier gate (post-beta) |
| Export | Description |
|---|---|
usePrivy | Core authentication hook (re-exported) |
useLogin | Trigger login programmatically |
useLogout | Trigger logout programmatically |
These exports provide lower-level access for advanced use cases. All are currently exported and available.
| Export | Description |
|---|---|
useWallets | Access all connected accounts (re-exported) |
useToast | Show toast notifications (success, error, info) |
useTheme | Access current theme and presets from ThemeProvider |
useVarityPayment | Payment state and actions for in-app purchases |
| Export | Description |
|---|---|
DashboardLayout | Full dashboard layout with sidebar, header, footer |
DashboardHeader | Dashboard header bar |
DashboardSidebar | Sidebar navigation |
KPICard | Key metric display card |
StatusBadge | Status indicator badge |
EmptyState | Empty state placeholder with presets |
LoadingSkeleton | Loading skeleton variants (text, card, table, list) |
| Export | Description |
|---|---|
DataTable | Sortable, paginated data table |
AnalyticsCard | Analytics display card |
ChartContainer | Chart wrapper with actions |
MetricDisplay | Metric with trend indicator |
Sparkline | Inline sparkline chart |
| Export | Description |
|---|---|
ThemeProvider | Theme context provider with presets |
Logo | Varity logo component |
Attribution | Required “Powered by Varity” attribution |
import { PrivyStack, PrivyLoginButton, PrivyUserProfile, PrivyProtectedRoute, usePrivy,} from '@varity-labs/ui-kit';
function App() { return ( <PrivyStack appId={process.env.NEXT_PUBLIC_PRIVY_APP_ID} loginMethods={['email', 'google']} appearance={{ theme: 'light', accentColor: '#2563EB', logo: '/logo.png', }} > <Layout> <Header /> <PrivyProtectedRoute> <Dashboard /> </PrivyProtectedRoute> </Layout> </PrivyStack> );}
function Header() { const { authenticated } = usePrivy();
return ( <header> {authenticated ? ( <PrivyUserProfile showLogoutButton /> ) : ( <PrivyLoginButton>Sign In</PrivyLoginButton> )} </header> );}