Wocha Docs

UserProfile

Full account management with profile, security, sessions, and custom pages.

The <UserProfile> component provides a tabbed account management interface: profile editing, security (MFA, passkeys), active sessions, connected accounts, and organisation memberships. It requires apiUrl on your auth provider for Customer API calls.

Installation

pnpm add @wocha/ui @wocha/react
Or scaffold with the CLI
npx @wocha/cli init --framework nextjs
import { UserProfile } from "@wocha/ui";
import "@wocha/ui/styles.css";

Basic usage

<UserProfile
  sections={["profile", "security", "sessions", "connections", "organisations"]}
  passwordSettingsUrl="/account/password"
/>

Props

PropTypeDefaultDescription
appearanceWochaAppearanceVisual customisation
classNamestringAdditional class name
sectionsProfileSection[]All built-in sectionsSections to display
activeSectionProfileNavId"profile"Currently active section
onSectionChange(section) => voidCalled when the user changes section
onSave(data) => voidCalled after profile save
passwordSettingsUrlstringURL for hosted password change flow
hideNavigationbooleanfalseHide internal tab navigation (use with UserPortal)
fallbackReactNodeShown while profile data is loading
childrenReactNodeComposition children (UserProfile.Page, UserProfile.Link)

ProfileSection is "profile" | "security" | "sessions" | "connections" | "organisations".

Composition API

Add custom sidenav pages alongside built-in sections:

<UserProfile>
  <UserProfile.Page label="Billing" url="billing" icon={<CreditCard />}>
    <BillingPage />
  </UserProfile.Page>
  <UserProfile.Link label="Docs" url="https://docs.example.com" icon={<BookIcon />} />
</UserProfile>

Reorder built-in sections by using section keys as labels:

<UserProfile>
  <UserProfile.Page label="security" />
  <UserProfile.Page label="profile" />
</UserProfile>

Theming

<WochaThemeProvider
  appearance={{
    userProfile: {
      variables: { "--wocha-color-card": "#1a1a1a" },
    },
  }}
>
  <UserProfile />
</WochaThemeProvider>

Framework notes

FrameworkRequirement
React SPASet apiUrl in WochaProvider config
Next.jsPass apiUrl to WochaSessionProvider and WochaThemeProvider sdk="nextjs"

On this page