Skip to content

Create Account

Varity Team Core Contributors Updated March 2026

Accounts are created automatically when users sign in. No manual setup is needed.

When a user signs in through PrivyStack, Varity automatically:

  1. Authenticates the user via email or social login
  2. Creates a secure account linked to the user’s identity
  3. Manages account credentials — encrypted and recoverable, nothing for users to remember

Users see a familiar sign-in experience, just like any other modern app.

Use the pre-built PrivyUserProfile component for a ready-made profile display:

src/components/Profile.tsx
import { PrivyUserProfile } from '@varity-labs/ui-kit';
function ProfilePage() {
return (
<div>
<h2>Your Profile</h2>
<PrivyUserProfile />
</div>
);
}

After authentication, use usePrivy to access the current user’s details:

src/components/AccountInfo.tsx
import { usePrivy } from '@varity-labs/ui-kit';
function AccountInfo() {
const { authenticated, user, ready } = usePrivy();
if (!ready) return <p>Loading...</p>;
if (!authenticated) return <p>Please sign in first</p>;
return (
<div>
<p>User ID: {user?.id}</p>
<p>Email: {user?.email?.address || 'Not provided'}</p>
<p>Name: {user?.google?.name || user?.twitter?.name || 'Not provided'}</p>
</div>
);
}

Users can create accounts through any supported login method:

MethodDescription
EmailMagic link sent to email, no password needed
GoogleSign in via Google account
TwitterSign in via Twitter/X account
DiscordSign in via Discord account
GitHubSign in via GitHub account

All methods result in a secure account being created automatically.

src/components/AuthGate.tsx
import { usePrivy } from '@varity-labs/ui-kit';
function AuthGate({ children }) {
const { ready, authenticated } = usePrivy();
if (!ready) {
return <p>Initializing...</p>;
}
if (!authenticated) {
return <p>Please sign in to continue.</p>;
}
return <>{children}</>;
}
import { useLogout } from '@varity-labs/ui-kit';
function SignOutButton() {
const { logout } = useLogout();
return <button onClick={logout}>Sign Out</button>;
}
Advanced: Account Infrastructure

Varity automatically manages account infrastructure. For advanced use cases, see Session Keys.